Message Boards Message Boards

Find z-score?

GROUPS:

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!

POSTED BY: Kui Chen
Answer
10 days ago

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]}} *)
POSTED BY: Mariusz Iwaniuk
Answer
10 days ago

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

POSTED BY: Kui Chen
Answer
9 days ago

Also InverseCDF[]:

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

InverseCDF[NormalDistribution[], 95/100]
(*  Sqrt[2] InverseErfc[1/10]  *)
POSTED BY: Michael Rogers
Answer
10 days ago

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

POSTED BY: Kui Chen
Answer
9 days ago

Group Abstract Group Abstract