Repeated measures ANOVA
Means (parametric) · Three or more repeated measures · reference distribution: F
When to use it
Compare three or more conditions measured on the same individuals, such as several time points in a follow-up.
Null hypothesis
The means of all conditions are equal.
Assumptions
- Normal residuals
- Sphericity (check with Mauchly)
Test statistic
F = \dfrac{MS_{\text{conditions}}}{MS_{\text{error}}}Effect size
Partial η²: the variation due to conditions relative to itself plus the error.
\eta^2_p = \dfrac{SS_{\text{conditions}}}{SS_{\text{conditions}} + SS_{\text{error}}}How to report it
F(2, 38) = 6.12, p = .005, η²p = .24 (with the Greenhouse-Geisser correction, report the corrected df)
In R and Python
library(afex)
aov_ez("id", "y", df, within = "time")
from statsmodels.stats.anova import AnovaRM
AnovaRM(df, "y", "id", within=["time"]).fit()
In Python, stats is scipy.stats and np is numpy.
Variants and alternatives
- Greenhouse-Geisser or Huynh-Feldt corrections, if sphericity fails
- Friedman, without assuming normality
- Mauchly’s sphericity, to check the assumption
Where it sits in the catalog
Means (parametric). Parametric tests assume a model for the data, usually the normal distribution, and compare its parameters, such as the mean. When the assumption holds, they are the most powerful.
Three or more repeated measures. The same individuals measured under three or more conditions or time points: the paired design with more than two measurements.
In the decision tree
- What do you want to do? Compare groups, or one group with a reference value
- What kind of response did you measure? Numeric: a measurement, such as weight, time or score
- How many groups or measurements? Three or more groups
- Are the groups made of different individuals or the same individuals? The same individuals, under several conditions or time points
- Are the residuals approximately normal? Yes