Function correlatedAnova

Performs a correlated sample (within-subjects) ANOVA. This is a generalization of the paired T-test to 3 or more treatments. This function accepts data as either a tuple of ranges (1 for each treatment, such that a given index represents the same subject in each range) or similarly as a range of ranges.

TestRes correlatedAnova(T...) (
  T dataIn
)
if (allSatisfy!(isInputRange, T));

Returns

A TestRes with the F-statistic and P-value for the null that the the variable being measured did not vary across treatments against the alternative that it did.

Examples

// Test the hypothesis that alcohol, loud music, caffeine and sleep
// deprivation all have equivalent effects on programming ability.

uint[] alcohol = [8,6,7,5,3,0,9];
uint[] caffeine = [3,6,2,4,3,6,8];
uint[] noSleep = [3,1,4,1,5,9,2];
uint[] loudMusic = [2,7,1,8,2,8,1];
// Subject 0 had ability of 8 under alcohol, 3 under caffeine, 3 under
// no sleep, 2 under loud music.  Subject 1 had ability of 6 under alcohol,
// 6 under caffeine, 1 under no sleep, and 7 under loud music, etc.
auto result = correlatedAnova(alcohol, caffeine, noSleep, loudMusic);

References

"Concepts and Applications of Inferrential Statistics". Richard Lowry. Vassar College. version.

http

//faculty.vassar.edu/lowry/webtext.html