Message Boards Message Boards


Find z-score?

Posted 6 months ago
4 Replies
5 Total Likes

Hello, everyone. I know how to calculate the probability with Mathematica:

Probability[ x >= 1.0, x ~ NormalDistribution[] ]

The answer is 0.158655.

My question is, how can I find the z-score of normal distribution when the probability is given? For example, I want to find the value of z in the below pseudo-code:

Probability[ x >= z, x ~ NormalDistribution[] ] == 0.05

Or is there any ready-made function that can compute z-score directly in Mathematica? Thank you!

4 Replies

By numeric:

  NSolve[Probability[x >= z, x \[Distributed] NormalDistribution[]] == 5/100, z, Reals]
  (* {{z -> 1.64485}} *)

By symbolic:

   Solve[Probability[x >= z, x \[Distributed] NormalDistribution[]] == 5/100, z] // Quiet

   (* {{z -> Sqrt[2] InverseErfc[1/10]}} *)

Thank you! I found NSolve is better than Solve because the latter will give a warning message.

Also InverseCDF[]:

InverseCDF[NormalDistribution[], 0.95]
(*  1.64485  *)

InverseCDF[NormalDistribution[], 95/100]
(*  Sqrt[2] InverseErfc[1/10]  *)

Thanks a lot! I think this is the best solution!

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract