Repeated-measures ANOVA and sphericity (Mauchly’s test, Greenhouse–Geisser)
When the same subjects are measured over time, or the same experimental run includes three or more conditions, repeated-measures ANOVA is the standard parametric test. It removes subject-to-subject differences and so detects effects more easily, but it has its own assumption, sphericity, and when that fails the P values come out too small. This guide explains sphericity, Mauchly’s test and the Greenhouse–Geisser correction with a worked example.
What repeated-measures ANOVA does
- For paired data: the same subjects (or runs) measured under three or more conditions or time points
- Removes subject-to-subject differences from the error, so it finds effects more easily than ordinary ANOVA
- Assumes sphericity; when it fails, P values are too small, so consider a correction
- If the data are not close to normal, use the Friedman test
Ordinary one-way ANOVA treats all within-group variation as error. Repeated-measures ANOVA first takes out the part due to subjects (some animals are always high, some always low) and uses only the remainder as error when computing F.
Example: 6 animals × 4 time points
Grip strength in 6 mice measured at weeks 0, 1, 2 and 4 (made up).
| Animal | Week 0 | Week 1 | Week 2 | Week 4 |
|---|---|---|---|---|
| 1 | 52 | 58 | 66 | 71 |
| 2 | 48 | 55 | 59 | 75 |
| 3 | 55 | 60 | 70 | 69 |
| 4 | 50 | 54 | 61 | 80 |
| 5 | 47 | 56 | 63 | 67 |
| 6 | 53 | 57 | 68 | 78 |
| Mean | 50.8 | 56.7 | 64.5 | 73.3 |
| Source of variation | Sum of squares | df | F |
|---|---|---|---|
| Time | 1716.3 | 3 | 45.25 (repeated measures) |
| Subjects | 103.3 | 5 | — |
| Error (time × subject) | 189.7 | 15 | — |
| For reference: error ignoring pairing | 293.0 | 20 | 39.05 (one-way) |
Repeated-measures ANOVA gives F(3, 15) = 45.25, P = 9.4 × 10−8, with partial η² = 0.90. Removing the subject sum of squares (103.3) from the error makes F larger.
What sphericity means
Sphericity is the assumption that the variance of the differences is the same whichever two time points you pick. RM ANOVA uses a single error term for all comparisons between time points, so if the variance of the differences varies a lot between pairs, F is inflated and P is too small (more false positives).
| Pair of time points | Variance of differences |
|---|---|
| Week 1 − week 0 | 3.8 |
| Week 2 − week 0 | 4.7 |
| Week 4 − week 0 | 34.7 |
| Week 2 − week 1 | 6.2 |
| Week 4 − week 1 | 44.3 |
| Week 4 − week 2 | 58.2 |
Here, differences among weeks 0 to 2 have variances of about 4 to 6, while pairs involving week 4 have 35 to 58, around ten times larger. In the figure the lines fan out at week 4. In time-course experiments subjects often diverge over time, a typical way for sphericity to fail.
Mauchly’s test
The usual test is Mauchly’s test. Its null hypothesis is that sphericity holds; the statistic W (0 to 1, 1 meaning perfect sphericity) is tested against a chi-square distribution. Here W = 0.0315, χ²(5) = 12.87, P = 0.030, so sphericity is judged violated.
Greenhouse–Geisser and Huynh–Feldt corrections
The degree of violation is measured by ε (epsilon). It is 1 under perfect sphericity and at least 1/(k − 1) (1/3 here). The corrections keep F unchanged but multiply both degrees of freedom by ε before computing P.
| Method | ε | Corrected df | P |
|---|---|---|---|
| Uncorrected | 1 | 3, 15 | 9.4 × 10−8 |
| Huynh–Feldt | 0.453 | 1.36, 6.80 | 0.00020 |
| Greenhouse–Geisser | 0.398 | 1.20, 5.98 | 0.00043 |
| Lower bound (most conservative) | 0.333 | 1, 5 | 0.0011 |
Here the time effect stays clear after correction (P = 0.00043), but P is several thousand times larger than uncorrected; with smaller effects, the correction can decide significance.
Post hoc tests such as Tukey’s use the same error term, so they are affected too when sphericity is badly violated. Alternatives are paired t tests for each pair with Bonferroni or Holm adjustment, or a mixed-effects model.
Reading epsilon: Greenhouse–Geisser or Huynh–Feldt?
| Meaning | This example | |
|---|---|---|
| ε = 1 | Sphericity holds exactly; the correction leaves the df unchanged | — |
| Lower bound 1/(k − 1) | The smallest possible ε (k = number of conditions or time points); correcting with it is the most conservative option | 0.333 |
| Greenhouse–Geisser ε | ε estimated from the data; tends to run low, so the correction is conservative | 0.398 |
| Huynh–Feldt ε | A correction for the downward bias of the GG estimate; larger than GG, so the correction is more liberal (capped at 1 in BenchFig) | 0.453 |
- The further ε is from 1, the worse the violation of sphericity.
- A widely cited rule comes from Girden (1992): use Huynh–Feldt when ε is above 0.75, and Greenhouse–Geisser when ε is below 0.75 or nothing is known about sphericity. Above about 0.75, Greenhouse–Geisser is considered too conservative.
- Here the GG ε is 0.40, well below 0.75, so Greenhouse–Geisser is the choice.
- If in doubt, use Greenhouse–Geisser and report ε and which correction you used, so readers can judge.
Mauchly’s test vs Bartlett’s test of sphericity
Two different tests are called “tests of sphericity”, and their names are easy to mix up.
| Mauchly’s test of sphericity | Bartlett’s test of sphericity | |
|---|---|---|
| Used for | Checking the assumption of repeated-measures ANOVA | Checking, before factor analysis or PCA, whether the variables are worth combining |
| What it tests | Whether the variances of the differences between conditions are equal (sphericity) | Whether the correlation matrix of the variables is an identity matrix (no correlations at all) |
| A significant result means | Sphericity is violated → apply Greenhouse–Geisser or a similar correction | The variables are correlated → factor analysis is worthwhile |
| Reported with | Greenhouse–Geisser and Huynh–Feldt epsilons | KMO (Kaiser–Meyer–Olkin measure of sampling adequacy) |
| In R | afex and ez output, mauchly.test | cortest.bartlett in the psych package |
For repeated-measures ANOVA, the test you want is Mauchly’s. Bartlett’s test of sphericity (by M. S. Bartlett) is the one in SPSS’s “KMO and Bartlett’s Test” table for factor analysis and has nothing to do with the repeated-measures assumption. Note that significance points in opposite directions: for Mauchly a significant result is a problem, for Bartlett it is the green light for factor analysis.
Where to look in R and SPSS output
R (afex)
The ANOVA table from afex::aov_ez() or aov_car() shows Greenhouse–Geisser-corrected degrees of freedom by default (the line “Sphericity correction method: GG” appears under it). Fractional df such as 1.20, 5.98 tell you the correction has been applied. summary() adds Mauchly’s test and the Greenhouse–Geisser- and Huynh–Feldt-corrected results (ε and corrected P).
R (ez)
ez::ezANOVA() returns “Mauchly's Test for Sphericity” (W and p) and “Sphericity Corrections” (GGe, p[GGe], HFe, p[HFe]). GGe and HFe are the epsilons; p[GGe] and p[HFe] are the corrected P values. Both appear only for within-subject factors with three or more levels.
SPSS
In the “Mauchly's Test of Sphericity” table, read Mauchly’s W, Approx. Chi-Square, df and Sig., and the epsilons on the right (Greenhouse–Geisser, Huynh–Feldt, Lower-bound). The result itself is in “Tests of Within-Subjects Effects”: of the four rows “Sphericity Assumed”, “Greenhouse–Geisser”, “Huynh–Feldt” and “Lower-bound”, read the df, F and Sig. on the row of the correction you chose. F is the same in all four rows; only the df and P change.
What BenchFig does
On BenchFig’s Graph screen, choosing “Match by row” with three or more groups runs repeated-measures ANOVA with Tukey’s multiple comparisons (or the Friedman test if you choose Nonparametric). Rows with an empty group are excluded, and the number of excluded rows is shown. Assumption checks include Mauchly’s test of sphericity and the Greenhouse–Geisser and Huynh–Feldt epsilons; by default the Greenhouse–Geisser-corrected degrees of freedom and P are reported (can be turned off). Tukey’s comparisons after the ANOVA use the uncorrected error mean square.
How to write it in a paper
Methods: “Time points were compared using one-way repeated-measures ANOVA, with the Greenhouse–Geisser correction applied for departures from sphericity.” Results: give the corrected degrees of freedom, e.g. “Grip strength changed over time (F(1.20, 5.98) = 45.25, P < 0.001, ε = 0.40).” Reporting ε lets readers judge how far sphericity was violated. For general formats see how to report statistics.
FAQ
Is Bartlett’s test of sphericity the same thing?
No. Bartlett’s test of sphericity checks, before factor analysis or PCA, whether the correlation matrix of the variables is an identity matrix (no correlations at all). The sphericity assumption of repeated-measures ANOVA is checked with Mauchly’s test.
Do I need to check sphericity with only two time points?
No. With two conditions there is only one difference, so sphericity always holds (the RM ANOVA equals the paired t test, F = t²). Sphericity matters from three conditions upwards.
If Mauchly’s test is not significant, can I skip the correction?
Mauchly’s test misses violations with small n and flags trivial ones with large n. Many therefore recommend applying the Greenhouse–Geisser correction regardless, or at least reporting ε.
Greenhouse–Geisser or Huynh–Feldt?
Greenhouse–Geisser corrects a little too much (conservative); Huynh–Feldt a little too little. A commonly cited rule is Huynh–Feldt if ε > 0.75, Greenhouse–Geisser otherwise. If in doubt, use Greenhouse–Geisser and say which you used.
What about subjects with missing time points?
In repeated-measures ANOVA, a subject missing any time point is dropped entirely (BenchFig does the same). With many missing values or unequal n per time point, a mixed-effects model is a better fit.
Related guides
Product and journal names are trademarks or registered trademarks of their respective owners.