← Back to Blog

Repeated measures · ~7 min read

Repeated-Measures Analysis of Variance (ANOVA)

With two timepoints sphericity holds by definition. With four there are six pairwise differences, and each one has to behave.

In short

Repeated-measures ANOVA adds a requirement a paired t-test never has to satisfy: sphericity, meaning the variance of the difference between every possible pair of repeated measurements has to be roughly equal.1 With only two timepoints there is exactly one pair of differences, so sphericity is automatically satisfied; the assumption only becomes a live constraint once a design reaches three timepoints, which describes most postoperative follow-up series. Mauchly’s test flags a violation, and left uncorrected, the ordinary F-test’s Type I error rate climbs above the nominal .05, worse as the number of timepoints grows and the sample shrinks.3 The fix is a degrees-of-freedom correction — Greenhouse-Geisser when the estimated epsilon falls below 0.75, Huynh-Feldt when it does not1,2 — and when the outcome itself is ordinal, skewed, or the sample is too small to trust normality in the first place, no correction rescues repeated-measures ANOVA at all; that is exactly the situation the Friedman test was built for.4

The assumption that only shows up past two timepoints

A paired t-test compares two measurements per patient and asks one question: is the mean difference different from zero. Repeated-measures ANOVA gets reached for as the natural extension once a third, fourth, or fifth timepoint joins that same design — preoperative, postoperative day one, six weeks, three months — and in one sense it is a natural extension: the logic of comparing within-patient change over time carries across. What does not carry across is the assumption set. Repeated-measures ANOVA needs sphericity: the variance of the difference between any two levels of the repeated factor has to be roughly constant across every possible pair of levels, not merely similar on average.1 With two timepoints there is exactly one pairwise difference, so there is nothing for the variances to differ across, and sphericity holds by definition — a paired t-test never has to think about it. Add a third timepoint and the number of pairwise differences goes from one to three; a fourth timepoint makes it six. Each of those pairs now needs a roughly equal variance for the ordinary F-test to be trustworthy, and it is checked with Mauchly’s test of sphericity, printed automatically by any package that runs the procedure.

What an unflagged violation does to the P value, and how the two corrections differ

A sphericity violation is not cosmetic. Haverkamp and Beauducel modelled repeated-measures ANOVA under varying degrees of sphericity violation, in designs with up to nine measurement occasions, and found the uncorrected F-test’s Type I error rate climbing well above the nominal .05 as sphericity worsened, an effect that got markedly more pronounced as the number of timepoints increased and the sample size shrank.3 A significant result from an uncorrected repeated-measures ANOVA on a four-timepoint recovery series is not automatically wrong, but the .05 threshold behind it is doing less work than the manuscript is claiming.

Two corrections exist, and both work the same way: they shrink the numerator and denominator degrees of freedom by an estimate of how far the data sit from perfect sphericity, an estimate labelled epsilon, which runs from a lower bound as sphericity worsens up to 1 at perfect sphericity. Greenhouse and Geisser introduced the first correction in 1959;2 it is the more conservative of the two, tending to underestimate epsilon, which shrinks the degrees of freedom further than strictly necessary and produces a larger, safer P value. The Huynh-Feldt correction estimates epsilon less conservatively and, at higher epsilon values, tends to overestimate it instead. The rule of thumb most software documentation and Girden’s reference text on repeated-measures ANOVA converge on is straightforward: use Greenhouse-Geisser whenever the estimated epsilon is below 0.75, and Huynh-Feldt when it is at or above that threshold.1 Below 0.75, the data are far enough from spherical that the extra conservatism is worth the loss of power; above it, the two corrections converge closely enough that Huynh-Feldt’s slightly higher power is the better trade.

A worked example: Mauchly’s test and the correction it triggers

The following is illustrative, constructed for demonstration and not drawn from a real dataset. Suppose knee flexion range of motion is recorded in 38 patients following total knee arthroplasty at four timepoints: preoperatively, and at 2, 6, and 12 weeks. Mauchly’s test returns W = 0.61, P = .01 — sphericity is violated, so the uncorrected “Sphericity Assumed” row is not the one to report. The associated Greenhouse-Geisser epsilon is 0.68, below the 0.75 threshold, so the Greenhouse-Geisser-corrected row governs rather than Huynh-Feldt. The results section reads: “Knee flexion range of motion differed significantly across the four postoperative timepoints (repeated-measures ANOVA with Greenhouse-Geisser correction: F(2.04, 75.5) = 41.2, P < .001, partial η2 = 0.53).” Note the non-integer degrees of freedom in both positions of the F statistic — 2.04 and 75.5, rather than the whole-number 3 and 111 the uncorrected test would have used — which is the correction visibly doing its job on the page, not a typo.

A sphericity correction does not rescue a non-normal outcome. Greenhouse-Geisser and Huynh-Feldt fix the degrees of freedom of an F-test that still assumes the repeated measurements are close to normally distributed and measured on an interval scale. If the outcome is ordinal — a pain score, a wound-healing grade, a Likert-scale function rating — badly skewed, or the sample is too small to trust a normality check at all, correcting the degrees of freedom does not address that; it just changes which wrong-shaped test is being reported. That is a different problem, with a different fix.

When correction isn’t enough, and Friedman takes over

The Friedman test was built for exactly the situation the box above describes.4 Instead of comparing means and needing either normally distributed differences or a sphericity correction to stay valid, it ranks each patient’s own measurements across the repeated timepoints and compares how those ranks are distributed, which needs no assumption about the shape of the underlying data and no assumption about the variance of the differences between any pair of timepoints. The practical decision point is the outcome itself, checked before Mauchly’s test is even run: if the repeated measurements are ordinal, sharply skewed, or the sample is small enough that a normality check can’t be trusted, that rules out repeated-measures ANOVA regardless of what sphericity turns out to look like, and the Friedman test is the right tool from the start, not a fallback reached for only after a correction fails to help. Where repeated-measures ANOVA is genuinely appropriate — a reasonably normal, interval-level outcome — sphericity and its corrections are the assumption that actually governs which row of the output belongs in the manuscript, and that is covered in full, including the ranking mechanics and a worked example, in the Friedman test post linked below.

How to run it — SPSS vs StatsPlease

In IBM SPSS Statistics (documentation current to version 32), the path is Analyze ▸ General Linear Model ▸ Repeated Measures…. The first dialog, “Define Factor(s),” is where the within-subjects factor gets named — “Timepoint” or similar — with the number of levels set to the number of repeated measurements, then Add and Define; the related variables then move into the “Within-Subjects Variables” box in level order. SPSS produces Mauchly’s Test of Sphericity automatically, with its own significance value and the Greenhouse-Geisser epsilon printed alongside it, and a Tests of Within-Subjects Effects table with a separate row each for Sphericity Assumed, Greenhouse-Geisser, Huynh-Feldt, and Lower-bound. The common misread is not a wrong click; it is reading straight down the Sphericity Assumed row out of habit, because SPSS does not grey it out or block it, even after Mauchly’s result above has already flagged that row as the wrong one to cite.

Upload the dataset (or the relevant repeated-measurement columns). StatsPlease’s deterministic engine identifies the appropriate test from the variable type and study design, checks the relevant assumptions, computes the result using fixed, non-LLM algorithms, and drafts the Methods/Results sentence in AMA format — the same number a reader would get running the test by hand in SPSS.

References

  1. Girden ES. ANOVA: Repeated Measures. Newbury Park, CA: Sage Publications; 1992.
  2. Greenhouse SW, Geisser S. On methods in the analysis of profile data. Psychometrika. 1959;24(2):95-112.
  3. Haverkamp N, Beauducel A. Violation of the sphericity assumption and its effect on Type-I error rates in repeated measures ANOVA and multi-level linear models (MLM). Front Psychol. 2017;8:1841.
  4. Friedman M. The use of ranks to avoid the assumption of normality implicit in the analysis of variance. J Am Stat Assoc. 1937;32(200):675-701.

Which row of that within-subjects table belongs in your manuscript shouldn’t depend on which one happens to print first.

StatsPlease’s deterministic engine runs Mauchly’s test on every repeated-measures comparison in your uploaded data, applies the Greenhouse-Geisser or Huynh-Feldt correction when sphericity is violated — or routes to the Friedman test when the outcome itself calls for it — and states in the drafted Results sentence which version it used and why.

Try StatsPlease free