Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Computing percentile / probability using zscore

Tags:

julia

For the following example how do I compute the percentile / probability values / tail area in julia

 Example : N(1100, 200) #Normally distributed with mean 1100 & standard deviation 200 for lets say SAT score
 x = 1030 #Lets say students SAT score
 
 #manual calculation
 z-score = (x-mean)/std.dev = 1030-1100 / 200 = -0.35
 #using the probability table the tail area corresponding to this is 0.3632

The zscore can be computed using the stats base package.

using StatsBase 
zscore([1030], 1100, 200) 
# Out > 0.35

How do i compute the corresponding probability (0.3632) obtained from the statistical tables?

like image 674
imantha Avatar asked May 18 '26 20:05

imantha


1 Answers

Turning @DNF's comment into an answer:

You can use the cdf function from Distributions.jl:

julia> using Distributions

julia> cdf(Normal(1100, 200), 1030)
0.3631693488243809
like image 168
Cameron Bieganek Avatar answered May 20 '26 16:05

Cameron Bieganek



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!