Function fTest

The F-test is a one-way ANOVA extension of the T-test to >2 groups. It's useful when you have 3 or more groups with equal variance and want to test whether their means are equal. Data can be input as either a tuple or a range. This may contain any combination of ranges of numeric types, MeanSD structs and Summary structs.

TestRes fTest(T...) (
  T data
);

Note

This test makes the assumption that all groups have equal variances, also known as homoskedasticity. For a similar test that does not make these assumptions, see welchAnova.

Examples

uint[] thing1 = [3,1,4,1],
       thing2 = [5,9,2,6,5,3],
       thing3 = [5,8,9,7,9,3];
auto result = fTest(thing1, meanStdev(thing2), summary(thing3));
assert(approxEqual(result.testStat, 4.9968));
assert(approxEqual(result.p, 0.02456));

References

http://en.wikipedia.org/wiki/F-test

Returns

A TestRes containing the F statistic and the P-value for the alternative that the means of the groups are different against the null that they are identical.