How to run a repeated measures ANOVA
- Copy long format data (subject ID, condition and measurement columns) or wide format data (one row per subject, one column per time point) with the header.
- For long format, select the subject ID, condition/time and measurement columns; for wide format, select the subject ID column and add the time point columns in order with 'Add →'.
- Press Analyze and check the p-value in the repeated measures ANOVA table (the GG-corrected p if sphericity is violated) and the comparisons between time points.
Worked example with sample data
The sample data are 30 rows in long format (Specimen, Curing time, Compressive strength): the 1-day, 7-day and 28-day compressive strength (MPa) of 10 specimens (S01 to S10).
The mean strengths are 14.96 (1 day), 23.09 (7 days) and 31.7 MPa (28 days). Mauchly's test gives W = 0.6386, p = 0.1663, so sphericity holds and the uncorrected p-value is used: F(2, 18) = 227.8, p = 1.653e-13, a significant difference by curing time (effect size ng² = 0.9123).
The Greenhouse-Geisser corrected p-value is also significant at 1.975e-10 (ε = 0.7345). In the post hoc comparisons (paired t tests + Holm correction), 1 day - 7 days (up 8.13), 7 days - 28 days (up 8.61) and 1 day - 28 days (up 16.74) are all significant.
In the individual profile plot all 10 specimen lines rise to the upper right, so the strength gain appears consistently across specimens. The 28-day standard deviation (3.154) is larger than the 1-day one (1.469), so the differences between specimens widen as curing progresses.
How it is calculated
The variation between subjects is removed from the total, and the remaining within-subject variation is split into the condition effect and error: F = MS condition / MS error with (k-1, (k-1)(n-1)) degrees of freedom. Only subjects with values for every condition are used.
Mauchly's test checks sphericity (equal variances of the pairwise differences between conditions); if it is violated, the p-value corrected with the Greenhouse-Geisser ε is used. The effect size is the generalized eta squared (ng²).
Comparisons between time points
For each pair of time points, a paired t test is run on the per-subject differences, corrected for multiple comparisons with the Holm method.
What the result shows
Descriptive statistics by time point, the repeated measures ANOVA table, Mauchly's sphericity test, comparisons by time point, an individual profile plot, the mean trend by time point with confidence intervals, and a box plot.
How to read the repeated measures ANOVA result
- If Mauchly's p-value is 0.05 or more, use the uncorrected p-value; below 0.05, use the GG-corrected p-value. The interpretation tells you which one it used.
- If most lines in the individual profile plot move in the same direction, the time effect appears consistently across subjects.
- The comparison table shows between which time points there is a significant change.
Frequently asked questions
How is it different from one-way ANOVA?
Repeated measurements on the same subjects are not independent, so one-way ANOVA should not be used. Repeated measures ANOVA removes the differences between subjects from the error, making the test more sensitive.
What about subjects with missing measurements?
Only subjects with values for every condition are used, and at least 3 such subjects are needed.
What if there are only 2 conditions?
The result is the same as the paired t test, and sphericity always holds.