File Exchange

image thumbnail


version 1.0 (20.6 KB) by

Adjustment of the F statistic by Epsilon on Repeated Measures ANOVA.

1 Download


View License

Sphericity is an assumption of repeated measure ANOVA. It means that the variance-covariance structure of the repeated measure ANOVA follows a certain pattern. Sphericity is, in a nutshell, that the variances of the differences between the repeated measurements should be about the same. Violations of the sphericity assumption lead to biased P-values. The alpha error of a test may be set at 5, but the test may be actually rejecting the null hypothesis 10 of the time. This raises doubts of the conclusions of the repeated measure ANOVA.
In repeated measure experiments the same subjects are tested multiple times under different conditions. It is a good idea to check if the responses made under some conditions are correlated more closely than responses made under other conditions.
Box (1954) showed that if the sphericity assumption is not met, then the F ratio is positively biased (we are rejecting felasely too often). According to Greenhouse and Geisser (1959), the extent to which the covariance matrix deviates from sphericity is reflected in a parameter called epsilon. Epsilon is then used to adjust for the potential bias in the F statistic.
To adjust for the positive bias it is suggested altering the degrees of freedom of the F-statistic. Both adjustements estimate epsilon and then multiply the numerator and denominator degrees of freedom by this estimate before determining significance levels for the F-tests. Significance levels associated with the adjusted tests are labeled adjP > F on the output.

Syntax: function adjPF(X,F)

X - Input matrix can be a data matrix (size n-data x k-treatments)
F - Observed (calculated) F statistic value

The adjustment of the F statistic can be by Epsilon menu for:
1) Greenhouse-Geisser
2) Huynh-Feldt
3) Box's conservative

p - adjusted P-value.

Comments and Ratings (4)


Ben (view profile)

The function seems to return values equal to two times p(F>empirical F). I suspect this problem was spotted by the author before (given the update on this). But the values returned by the current version of the function still are twice as big as they should be (and thus sometimes >1). Line 161 and 168 read '2*(1-fcdf(F, DF1, DF2))'. The '2*' appears to be a bug.

David Groppe

David Groppe (view profile)


Is it possible to couple this function to RMAOV1MS so that the returned p-value is corrected?
I want to use the adjustment in an univariate design with 2 groups measured across time, and I don't see how to apply this function to this data otherwise.


pi over2

could you please add this to your RMOVA1 and RMOVA2 codes?


It was added an appropriate format to cite this file.

MATLAB Release
MATLAB 7 (R14)

Inspired: Huynh-Feldt epsilon general procedure

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Win prizes and improve your MATLAB skills

Play today