ANOVA One way - mauriceling/mauriceling.github.io GitHub Wiki

Purpose: To test whether the means of populations where 2 or more samples were drawn from are equal.

Null hypothesis: All population means are equal.

Alternate hypothesis: At least one population mean is not equal to the rest.

Note: One-way ANOVA assumes variances of all samples to be equal. If variances cannot be assumed to be equal, Alexander Govern test can be used.

Code:

>>> from scipy import stats
>>> X1 = [9.07, 8.97, 6.41, 3.03, 1.19, 2.67, 2.81, 9.2]
>>> X2 = [3.82, 8.26, 5.99, 3.81, 1.07, 5.06, 5.66, 4.47]
>>> X3 = [8.46, 7.46, 4.48, 1.41, 3.16, 1.77, 5.33, 6.61]
>>> result = stats.f_oneway(X1, X2, X3)
>>> print("F = %.3f" % result.statistic)
F = 0.137
>>> print("p-value = %.3f" % result.pvalue)
p-value = 0.872