# [SciPy-User] [SciPy-user] Anova and the level of significance

josef.pktd@gmai... josef.pktd@gmai...
Sat Apr 10 12:29:11 CDT 2010

```On Sat, Apr 10, 2010 at 12:42 PM, guts <stephane.campinas@deri.org> wrote:
>
> Hello,
>
> I used the #f_oneway method from scipy.stats to compute the f_value and the
> critical value. To test it, i used the groups given in this book [1], which
> are:
>
>                                                               Alternatives
> Measurements                                1               2         3
> 1                                                0.0972      0.1382
> 0.7966
> 2                                                0.0971      0.1432
> 0.5300
> 3                                                0.0969      0.1382
> 0.5152
> 4                                                0.1954      0.1730
> 0.6675
> 5                                                0.0974      0.1383
> 0.5298
>
> The F-value calculated is:          66.4     and the critical value is
> 3:89 (with a level of significance of 0.05).
> Those returned by the f_oneway method are, respectively:       66.37 and
> 3.2462326729e-07.
>
> I don't understand why the critical value is so much smaller. I wanted to
> get the level significance from the method
> but didn't find how. Do you have an explanation for this number?

It took me a bit of time to figure out the degrees of freedom for your example

3.89 is the f-value  at a significance level of 0.05
>>> stats.f.sf(3.89, 2, 15-3)
0.049857414449464656

For this dataset, the f-value is much higher than the 5% critical
value, this means that the p-value, i.e. the probability that the f
value of 66.37 would be observed under the null hypothesis is tiny

>>> stats.f.sf(66.37, 2, 15-3)
3.2475516470133395e-007

So the null hypothesis of identical means (no differences across
groups) can be rejected with a very high confidence level.

>>> x.mean(0)
array([ 0.1168 ,  0.14618,  0.60782])

I hope this helps,
(I have verified f_oneway against the NIST benchmark cases, and the
results are correct except for very badly scaled examples.)

Josef

>
> Thanks for the help!
>
> [1]: Measuring computer performance: a practitioner's guide, By David J.
> Lilja
>
> -----
> Stephane Campinas
> --
> View this message in context: http://old.nabble.com/Anova-and-the-level-of-significance-tp28194677p28194677.html
> Sent from the Scipy-User mailing list archive at Nabble.com.
>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>
```