[SciPy-user] Incorrect stats t-values
Joseph Malicki
jmalicki at computer.org
Wed May 30 10:21:27 EDT 2007
Yes you are.
The T-Table (as most seem to) is for a *two-tailed* confidence
interval that you'd be using a t distribution for... i.e. the middle
95%. scipy.stats is calculating a one-tailed interval, or the
leftmost 95%.
If you want a 95% interval, that's alpha of .05.... you want to call
t.ppf with 1-alpha/2,
which is 0.975
In [4]: scipy.stats.t.ppf(0.975,2)
Out[4]: array(4.3026527299112747)
So your confidence interval is (-n,n) where n=scipy.stats.t.ppf(1.0-alpha/2,2)
On 5/30/07, Jeff Moreland <JMoreland at ansell.com> wrote:
>
>
> The stats.py module seems to incorrectly calculate values for the
> T-Distribution:
>
> >> stats.t.ppf(0.95, 2)
> outputs
> >> 2.91998558036
>
> However, the correct value from a T-table is 4.3027.
>
> Am I using the function correctly? I am attempting to determine the
> critical t-values based on a probability and the degrees of freedom.
>
> Jeff Moreland
>
> ____________________________________________________________________________________
> This e-mail (including any attachments) is intended only for the exclusive
> use of the individual to whom it is addressed. The information contained
> hereinafter may be proprietary, confidential, privileged and exempt from
> disclosure under applicable law. If the reader of this e-mail is not the
> intended recipient or agent responsible for delivering the message to the
> intended recipient, the reader is hereby put on notice that any use,
> dissemination, distribution or copying of this communication is strictly
> prohibited. If the reader has received this communication in error, please
> immediately notify the sender by telephone or e-mail and delete all copies
> of this e-mail and any attachments. Thank you.
> _______________________________________________
> SciPy-user mailing list
> SciPy-user at scipy.org
> http://projects.scipy.org/mailman/listinfo/scipy-user
>
>
More information about the SciPy-User
mailing list