0

I have the sample size of 20 with standard deviation of 5.46. I have calculated the value in t distribution i.e. t1-α/2,n-1 = t0.975,19 = 2.093 by using the code below:

scipy.stats.t.ppf( 1-(1-gamma)/2, N-1)

but how can i get the value in z distribution with the same sample size and standard deviation so that the value should be 1.96 by using Z1-α/2 = Z0,975 = 1.96

bikuser
  • 2,013
  • 4
  • 33
  • 57
  • 1
    According to the [docs](http://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.norm.html#scipy.stats.norm), `scipy.stats.norm.ppf` exists - does it not do what you want? – lvc Jul 27 '15 at 09:01
  • 1
    I think this question has been asked and answered [here](http://stackoverflow.com/questions/20626994/how-to-calculate-the-inverse-of-the-normal-cumulative-distribution-function-in-p) – saulspatz Jul 27 '15 at 09:03
  • @saulspatz i used this function norm.ppf(0.95, loc=145, scale=5.46) but i got the different value. could you please where might be the problem? – bikuser Jul 27 '15 at 09:13
  • @Ivc it will give the different value which is different that what i expected. – bikuser Jul 27 '15 at 09:14
  • 1
    In your question you're stating that the standard deviation is 5.46, but the code calculates the ppf assuming the default loc=0 and scale=1. Indeed if you use the `scipy.stats.norm.ppf(0.975)` you'll get the 1.96 value, but that's for mean 0 and std 1 again. – abudis Jul 27 '15 at 09:23
  • @abudis ohh thanks now I got it. :) – bikuser Jul 27 '15 at 09:29

0 Answers0