ANOVA Family · General Linear Model
One-Way Repeated-Measures ANOVA
A repeated-measures ANOVA compares the same people's means across three-plus conditions.
A one-way repeated-measures ANOVA takes one continuous outcome measured in the same people under three or more conditions and tests whether the condition means all equal each other.
Does anxiety about spiders fall over a course of exposure therapy? Twenty-four adults with a fear of spiders rated their anxiety from 0 to 100 while approaching a spider in a tank, before treatment, after three weekly exposure sessions and after all six.
- Tests
- Differences among condition means within the same people
- Observations
- Related
- Parametric
- Yes
- Headline Statistic
- F
- Effect Size
- Generalized Eta Squared
- Groups
- 3+
The Basics
When to Use It
Use it when the same people are measured on one continuous outcome under three or more conditions, or at three or more times, and you want to know whether the averages differ. Because each person is compared with themselves, stable differences between people drop out of the noise. For example:
- Does anxiety about spiders fall over a course of exposure therapy?
- Does reaction time on a driving simulator change after one, two and three drinks?
- Do students recall different numbers of words after studying them with imagery, rote rehearsal or a story?
Vocabulary You Need
Definition Between-Subjects Sum of Squares (SS_{\text{subjects}})
Each person's average across the conditions, its squared distance from the grand mean, counted once for every condition, then added up. It measures how much people differ from one another overall, the ones who score high everywhere versus the ones who score low. A repeated-measures design can set this variation aside, because every person appears in every condition, so it never counts as noise. Glossary →
Definition Error Variance (MS_{\text{error}})
The error sum of squares divided by its degrees of freedom. It is the background noise that an effect's variance is compared with in the F ratio. In a repeated-measures ANOVA it's the variation in how people change across conditions, with stable differences between people already removed, so it is usually much smaller than the within-groups variance the same scores would give in a between-subjects ANOVA. Glossary →
Definition Epsilon (Sphericity Correction) (\varepsilon)
A number that measures how far repeated-measures data are from sphericity, where every pair of conditions has the same variance of difference scores. It is 1 when sphericity holds exactly and can fall as low as 1/(k − 1) for k conditions. Multiplying both of the F test's degrees of freedom by an estimate of ε, usually the Greenhouse-Geisser or Huynh-Feldt estimate, gives a corrected p-value that keeps false positives close to the intended rate when sphericity doesn't hold. Glossary →
Definition F Statistic (F)
The variance due to an effect divided by the error variance it is tested against: in a between-subjects ANOVA, the between-groups variance over the within-groups variance; in a repeated-measures ANOVA, the conditions' variance over the inconsistency in how people change across them. It is near 1 when there's no real effect and grows as the effect stands out from the error. It is compared with an F distribution, which has two degrees of freedom, to get a p-value. Glossary →
Assumptions and Inference
1. Independent Clients (for the p-Value and Intervals) Each client's three ratings belong together, but different clients are independent of one another.
- What It Means
- Each person's data comes from a separate, unconnected source, so knowing one person's scores tells you nothing about anyone else's. In designs that measure people more than once, their own scores are meant to be related; it's different people who must be independent. Methods built for clustered data, such as multilevel models and GEE, also allow members of the same group to be related, as long as the analysis names the grouping; then it's the groups that must be independent.
- Applies To
- Observations
- How to Check
- By design, not by a test. Did each person contribute their own data, with no clusters such as roommates, couples, therapy groups or classrooms whose members influence each other? If there are clusters, does the analysis model every one of them?
- How Much It Matters
- A lot. Each client's own three ratings are meant to be related, but different clients must not influence each other. If clients were treated in groups and talked each other up or down, their scores are more alike than the test expects, and p comes out too small.
What to Do
- Alternative Test Multilevel Regression (HLM). A multilevel model with random effects for people and for the groups they belong to.
- Design Change Treat and assess each person on their own.
2. Normality of the Within-Person Changes (for the p-Value and Intervals) The exact F-test assumes multivariate-normal errors, which in practice means looking at each client's changes between conditions, not just a histogram at each time point. Moderate departures are often tolerated, especially with more people, but strong skew or extreme changes can still matter.
- What It Means
- The test's model assumes the scores it relies on are roughly normal: the scores within each group (or the scores themselves, for a one-sample test), the difference scores in a paired design, or the residuals (the errors left around a model's predictions) in a regression. For p-values and confidence intervals, what really matters is that the estimates (such as a mean, a difference between means or a model's coefficients) are roughly normal across repeated samples. A large enough sample usually provides that; how large depends on how skewed the scores are and how extreme their outliers.
- Applies To
- Residuals
- How to Check
- Compute each person's change for each pair of conditions (here midway − before, after − midway and after − before) and look at their histograms or Q–Q plots for strong skew or extreme changes. Histograms of each time point's raw scores help less: they mostly show how differently people started. Don't rely on a normality test: with small samples it misses real problems, and with large ones it flags trivial ones.
- How Much It Matters
- Little, if sphericity holds: in simulations with 3 to 8 time points and 10 to 300 people, skewed and heavy-tailed data barely moved the false-positive rate or power (Blanca et al., 2023a). Extreme outliers matter more, because one unusual change can dominate the error term. Our clients' three sets of changes show no strong skew (skewness −0.38 to 0.04), and no change is more than 2.3 standard deviations from its average.
What to Do
- Alternative Test Friedman Test. It compares conditions by ranking each person's scores, so the question changes to whether some conditions tend to come out higher: use it when that's your question, not just because scores are skewed. Ranks throw away how far apart each person's scores are, so it can disagree with the ANOVA: on our data it isn't significant.
-
Robust Estimation
A robust repeated-measures ANOVA on trimmed means (R:
WRS2::rmanova) resists outliers. It compares trimmed means, not ordinary means. - Transformation Log-transform right-skewed outcomes such as reaction times. Results are then on the log scale.
3. Sphericity People's changes vary about equally between every pair of conditions.
- What It Means
- Take each person's difference score between two conditions. Sphericity means those difference scores have the same variance for every pair of conditions. When it fails, the usual F test comes out too liberal, giving too many false positives. It only matters for an effect with more than one degree of freedom: a factor with three or more levels, or an interaction involving one. In a factorial design each effect is checked on its own; a factor with two levels has only one set of differences.
- Applies To
- Covariance structure
- How to Check
- Compute the variance of the difference scores for each pair of levels of a factor (in a factorial design, after averaging over the other factors) and compare them, and look at the Greenhouse-Geisser epsilon (ε), which software prints for each effect. Mauchly's test is common, but it misses real violations in small samples and flags trivial ones in large samples, so don't let it decide whether to correct.
- How Much It Matters
- It matters, because the uncorrected F gets more liberal as sphericity fails (Blanca et al., 2023b). In the exposure-therapy study, clients' changes varied about equally from before to midway and from midway to after (variances 113.65 and 115.83), but twice as much from before to after (229.48). The Greenhouse-Geisser ε is .80, and the correction moves p from .011 to .017.
What to Do
- Correction Multiply both degrees of freedom by the Greenhouse-Geisser ε. The more conservative correction, and what we report: F(1.60, 36.80) = 5.02, p = .017. When it rejects the null, Huynh-Feldt will too (Blanca et al., 2023b).
- Correction A less conservative estimate of ε. Blanca et al. (2023b) recommend Greenhouse-Geisser when ε is below .60 and Huynh-Feldt when it is between .60 and .90. Ours, .80, is in the Huynh-Feldt range: ε = .85, p = .015, the same conclusion as Greenhouse-Geisser. We report Greenhouse-Geisser because we chose it in advance as the more conservative correction; following Blanca et al., reporting Huynh-Feldt here would be just as defensible.
- Alternative Test MANOVA. Treats the difference scores as several outcomes and doesn't assume sphericity, at a cost in power with few people. For our data it gives F(2, 22) = 3.20, p = .060.
- Alternative Test Multilevel Regression (HLM). Lets the variances and correlations across time points differ instead of assuming sphericity.
4. Complete Data (for Standard Repeated-Measures ANOVA) The standard analysis uses only people with a score at every time point. Missing scores don't break the test's logic, but anyone incomplete is dropped, which costs precision and can bias the result.
- What It Means
- The test compares conditions within each person, so it needs each person's full set of scores. Anyone missing a condition is dropped from the analysis entirely.
- Applies To
- Observations
- How to Check
- Count the people with a missing condition and ask why they're missing. If dropouts are more likely in one condition, dropping them can bias the result.
- How Much It Matters
- Depends on why data are missing. Anyone missing a time point is dropped entirely. If clients who felt worse skipped the midway assessment, dropping them would make the therapy look better than it is. A mixed model keeps their available scores, but it only fixes that bias if the missingness is explained by what the model includes, such as their earlier scores; it can't correct dropout driven by something unmeasured.
What to Do
- Alternative Test Multilevel Regression (HLM). Uses everyone's available scores instead of dropping incomplete people.
- Proceed with Caveat Say how many people were dropped and at which time point, so readers can judge the risk.
Limitations
This Is Not Your Test If…
- You measured the same people only twice Paired-Samples t-Test →
- Each condition has different people One-Way Between-Subjects ANOVA →
- You also have separate groups, like a control group Mixed Factorial ANOVA →
- You have two within-person factors Factorial Repeated-Measures ANOVA →
- Your outcome is ordered ratings, or your question is how people tend to order the conditions rather than how far apart their means are Friedman Test →
- Some people are missing some time points Multilevel Regression (HLM) →
What It Doesn't Tell You
- Which time points. The omnibus test only says the three averages aren't all equal. Which ones differ comes from the follow-up comparisons.
- Why. With no untreated comparison group, the drop could come from the therapy, from simply getting used to the spider test, or from clients who signed up at their most anxious drifting back toward normal. A mixed design with a waitlist group would separate these.
- Whether order mattered. Each person meets the conditions in some order, so practice, fatigue or carryover can look like a condition effect. When conditions can be reordered (study methods, say), counterbalance the order across people. When they can't (before, midway, after), only a comparison group separates change from repetition.
- Whether it matters. Significance doesn't make 8 points on a 0-to-100 rating a change clients would notice in daily life.
- That nothing happened by midway. The midway rating didn't differ reliably from either end, but each of those differences has a wide interval, from about 8.5 points lower to about half a point higher. That's inconclusive, not evidence that the first three sessions did nothing.
Common Mistakes
-
Don'tAnalyze repeated scores from the same people with a between-subjects ANOVA.
InsteadUse the repeated-measures ANOVA, which sets differences between people aside. On our data the wrong test gives p = .236.
-
Don'tLet a non-significant Mauchly's test talk you out of a sphericity correction.
InsteadLook at ε and report the Greenhouse-Geisser (or Huynh-Feldt) result by default.
-
Don'tFollow up with Tukey's HSD or t-tests on the pooled error term.
InsteadRun a paired t-test for each pair, using only that pair's differences, with a Holm correction.
-
Don'tReport the corrected p with the uncorrected degrees of freedom.
InsteadReport the corrected ones too, like F(1.60, 36.80), and name the correction.
-
Don'tAdd up the partial η² values as if they split the variation between them.
InsteadRemember each has its own denominator, so they can sum past 1. Report η² if you want shares of the total.
-
Don'tReport partial η² under the label η².
InsteadSay which one you report. SPSS prints partial η², which is never smaller than η² and is usually larger, especially with other effects or repeated measures.
-
Don'tRead a p-value as the chance that the null hypothesis is true.
InsteadRead it as: if the null were true, how often data at least this extreme would turn up.
Result Decoder
Significance and Effect Size Guidelines
Benchmarks Significance (p Value)
-
p < .001
Very strong evidence against the null hypothesis.
-
.001 ≤ p < .01
Strong evidence against the null hypothesis.
-
.01 ≤ p < .05
Statistically significant at α = .05. Moderate evidence against the null hypothesis.
-
.05 ≤ p < .10
Not significant. Weak evidence; sometimes called a “trend.” Treat it as inconclusive.
-
p ≥ .10
Not significant. Little evidence against the null, which is not the same as evidence of no effect.
These evidence labels are one common convention for describing p in graded language rather than as significant or not; the boundaries are rough guides, not rules, and other authors draw them differently. Muff et al. (2022) argue for this kind of language of evidence over a single cutoff. α is chosen before the analysis, and p never says how big or important an effect is.
Benchmarks Effect Size (Generalized Eta Squared)
-
η²G < .01
Below Small
Smaller than the conventional small benchmark. Whether an effect this size matters depends on the setting.
-
.01 ≤ η²G < .06
Small
A small effect next to the background variation: differences between people, measured factors and error. Hard to see without measuring it.
-
.06 ≤ η²G < .14
Medium
A noticeable effect next to the background variation.
-
η²G ≥ .14
Large
A large effect next to the background variation.
Cohen's (1988) η² benchmarks, which generalized η² can be held against because it keeps the differences between people in the denominator, as a between-subjects η² would. Lakens (2013) calls this a last resort: comparing with similar effects in the literature is better. Don't hold partial η² against them in a repeated-measures design.
How It's Reported
Equation Form
η²G = .04, η²p = .18, ε = .80, F(1.60, 36.80) = 5.02, p = .017
Table 1. Repeated-Measures ANOVA for Anxiety, with Sphericity Corrections
| \varepsilon | df_1 | df_2 | F | p | |
|---|---|---|---|---|---|
| Sphericity assumed | 2 | 46 | 5.02 | .011 | |
| Greenhouse-Geisser | .80 | 1.60 | 36.80 | 5.02 | .017 |
| Huynh-Feldt | .85 | 1.70 | 39.12 | 5.02 | .015 |
Note. The same F on every row; only the degrees of freedom, and so p, change. ε = the sphericity epsilon that multiplies both degrees of freedom. We report the Greenhouse-Geisser row.
Table 2. Pairwise Comparisons of Anxiety between Time Points
| M_{\text{diff}} | 95% CI | t | p_{\text{Holm}} | |
|---|---|---|---|---|
| Midway − before | −4.00 | [−8.50, 0.50] | −1.84 | .158 |
| After − midway | −4.00 | [−8.54, 0.54] | −1.82 | .158 |
| After − before | −8.00 | [−14.40, −1.60] | −2.59 | .049 |
Note. Paired t-tests, each on that pair's own difference scores, df = 23. Differences are the later time point minus the earlier one. The 95% CIs are unadjusted; p is Holm-adjusted across the three pairs.
Full Text (APA Style)
Clients' anxiety near the spider fell from before treatment (M = 62.00, SD = 16.28) to midway (M = 58.00, SD = 16.97) and after six sessions (M = 54.00, SD = 15.11). Of all the variation in ratings, differences between clients included, 4% lined up with time point, generalized η² = .04 (partial η² = .18). A one-way repeated-measures ANOVA with a Greenhouse-Geisser correction (ε = .80) showed the change was statistically significant, F(1.60, 36.80) = 5.02, p = .017. Paired t-tests with a Holm correction showed that anxiety was lower after treatment than before, by 8.00 points, 95% CI [1.60, 14.40] (unadjusted), p = .049; the midway rating did not differ reliably from either (both p = .158).
- Give every time point's M and SD, so readers can see the pattern the F summarizes.
- Name the sphericity correction and report its degrees of freedom, not the uncorrected 2 and 46. Give ε.
- Lead with generalized η², which compares across designs, and label partial η² if you give it too (many readers expect it). The two can differ a lot in repeated designs, as here (.04 versus .18).
- Follow a significant F with the pairwise comparisons, and name the correction.
- Italicize Latin symbols (M, SD, F, p) but not Greek ones (η², ε), and report exact p to three decimals.
Reading Each Piece
The equation form above, piece by piece, in this order: how big, then how surprising.
| η²G = .04 | About 4% of all the variation in anxiety ratings, differences between clients included, lines up with time point, a small effect by the benchmarks above. Partial η² (.18) looks larger only because it leaves those differences out, so don't hold it against the same benchmarks. Whether an 8-point drop in anxiety matters is a question about treatment, not statistics. Benchmarks ↑ |
| F(1.60, 36.80) = 5.02 | The time-point averages vary about five times as much as we'd expect from how inconsistently clients change. The 1.60 and 36.80 are the degrees of freedom, k − 1 = 2 and (k − 1)(n − 1) = 46, each multiplied by ε = .80. |
| ε = .80 | Clients' changes looked less than equally variable across the time points, so the test's degrees of freedom are shrunk to 80% of their usual size before p is found. |
| p = .017 | If the true averages were equal at every time point, an F at least this large would turn up about 2% of the time, judged against the corrected F distribution. That's below .05, so the result is statistically significant. With no untreated comparison group, it can't say whether therapy, practice with the spider test or regression to the mean produced the drop. Benchmarks ↑ |
Calculations
The Running Example
The exposure-therapy study: 24 clients, each rating their anxiety (0 to 100) near a spider three times: before treatment, midway and after six sessions.
- Null Hypothesis:
- \mu_{\text{before}} = \mu_{\text{midway}} = \mu_{\text{after}}
- Alternative:
- \text{not all three } \mu \text{ are equal}
Each \mu (“mu”) is the population mean anxiety rating at that time point, for all clients who could go through the program, which our averages of 62, 58 and 54 estimate. The alternative doesn't say which time points differ or in what direction. Because the same clients are measured every time, the test compares each client with themselves.
What Your Data Should Look Like
One score per person per condition. Most software wants it wide: one row per person, one column per condition. Ours is stored long, one row per person per condition, with columns for the person, the condition and the score; R and Python's pingouin use it as is, and SPSS needs it restructured to wide. Anyone missing a condition drops out.
| client | time | anxiety |
|---|---|---|
| 1 | before | 54 |
| 1 | midway | 56 |
| 1 | after | 45 |
| 2 | before | 48 |
| 2 | midway | 36 |
| 2 | after | 55 |
| … 66 more rows | ||
| n | M | SD | |
|---|---|---|---|
| Before | 24 | 62.00 | 16.28 |
| Midway | 24 | 58.00 | 16.97 |
| After | 24 | 54.00 | 15.11 |
24 clients × 3 times: every client has a score for every time.
Simulated data.
Napkin Math
The whole test, one idea at a time. Under each heading, a line says why the step matters, and the green note reads the equation in plain English with the exposure-therapy study's numbers. Collapse all to read just the headings: they tell the whole story on their own.
-
1. Find Each Time Point's Average and the Overall Average
The test compares the time-point averages with one another, and the easiest way to do that is to measure each one against the average of every rating.
\bar{x}_{\text{grand}} = \dfrac{\sum x_i}{N} =\dfrac{4176}{72}= 58.00 points
\bar{x}_{\text{before}} = 62.00
\bar{x}_{\text{midway}} = 58.00
\bar{x}_{\text{after}} = 54.00
\sum x_i is all 72 ratings added up, 4176, and N is the 72 ratings (24 clients × 3 times). 4176 ÷ 72 = 58.00 points, which is also the average of the three time-point means, 62, 58 and 54.
-
2. Measure How Far the Time-Point Averages Spread from the Overall Average
If the true averages were equal at every time point, the three sample averages would sit close to the overall one. This adds up how far they actually strayed, once for every client.
SS_{\text{conditions}} = n \sum (\bar{x}_j - \bar{x}_{\text{grand}})^2 =24\left[(62 - 58)^2 + (58 - 58)^2 + (54 - 58)^2\right]= 768
n is our 24 clients and \bar{x}_j each time point's average. Before is 4 above 58 and after is 4 below, so 24 × (16 + 0 + 16) = 768.
-
3. Measure How Much Clients Differ from One Another Overall
Some clients are much more afraid than others at every time point. Because each client is measured every time, we can measure those stable differences and set them aside, so they don't count as noise.
SS_{\text{subjects}} = k \sum (\bar{x}_i - \bar{x}_{\text{grand}})^2 =3\left[(51.67 - 58)^2 + (46.33 - 58)^2 + \dots + (74.33 - 58)^2\right]= 14451.33
\bar{x}_i is one client's own average across the three times, from 27.33 for the calmest client to 89.00 for the most afraid, and k is our 3 time points. The 24 squared distances add up to 4817.11, and 3 × 4817.11 = 14451.33.
-
4. Find the Noise That's Left Once Time and Clients Are Accounted For
What remains is how much clients' changes differ from the average change. Some fell a lot, some barely moved, a few got worse. That inconsistency is the noise the drop has to stand out from.
SS_{\text{error}} = SS_{\text{total}} - SS_{\text{conditions}} - SS_{\text{subjects}} =18738 - 768 - 14451.33= 3518.67
SS_{\text{total}} = 18738
SS_{\text{total}} is every rating's squared distance from 58, added up, 18738. Taking out time's 768 and the clients' 14451.33 leaves 3518.67, less than a fifth of the 17970 a between-subjects ANOVA would call noise.
-
5. Compare the Change over Time with the Leftover Noise
Turn each sum into an average by dividing by the pieces of information behind it, then take the ratio. If the true averages were equal, F would hover around 1.
F = \dfrac{MS_{\text{conditions}}}{MS_{\text{error}}} = \dfrac{SS_{\text{conditions}} / (k - 1)}{SS_{\text{error}} / [(k - 1)(n - 1)]} =\dfrac{768 / 2}{3518.67 / 46} = \dfrac{384}{76.49}= 5.02
MS_{\text{conditions}} = 384.00
MS_{\text{error}} = 76.49
k - 1 = 2 for our 3 time points and (k - 1)(n - 1) = 2 \times 23 = 46. MS_{\text{conditions}} = 768 ÷ 2 = 384 and MS_{\text{error}} = 3518.67 ÷ 46 = 76.49, so F = 384 ÷ 76.49 = 5.02.
-
6. Measure How Much of the Variation Lines Up with the Time Points
F grows with sample size; η² doesn't. Generalized η² asks what share of all the variation in ratings, differences between clients included, lines up with the time point, so it means the same thing as in a study with separate groups. Partial η², what SPSS prints, leaves the differences between clients out.
\eta^2_G = \dfrac{SS_{\text{conditions}}}{SS_{\text{conditions}} + SS_{\text{subjects}} + SS_{\text{error}}} =\dfrac{768}{768 + 14451.33 + 3518.67}= .04
\eta^2_p = .18
SS_{\text{conditions}} is our 768, and the denominator adds the clients' 14451.33 and the 3518.67 left over, 18738 in all. 768 ÷ 18738 = .04. Leaving the clients' share out, 768 ÷ (768 + 3518.67) = .18, the partial η².
-
7. Check Whether Clients' Changes Are Equally Variable across Time Points
The F test assumes clients' changes vary about as much between any two time points as between any other (sphericity). ε measures how far off that is, from 1 (not at all) down to .50 for three time points.
\hat{\varepsilon} = \dfrac{\left(\sum \lambda\right)^2}{(k - 1) \sum \lambda^2} =\dfrac{(114.74 + 38.24)^2}{2\,(114.74^2 + 38.24^2)}= .80
\lambda_1 = 114.74
\lambda_2 = 38.24
Score each client's overall trend as (after − before) ÷ √2 and their bend at midway as (before − 2 × midway + after) ÷ √6. The variances of these two scores are 114.74 and 38.25. \lambda_1 and \lambda_2 are, strictly, the eigenvalues of their covariance matrix, 114.74 and 38.24, nearly the same because the two scores barely correlate. If clients' changes were equally variable, the two would match and ε would be 1. Here 152.98² ÷ (2 × 14628.65) = .80.
-
8. Ask How Surprising the Drop Would Be If Anxiety Hadn't Really Changed
Finally, ask how often F would come out at least this large if the true averages were equal, judging F against a distribution with the corrected degrees of freedom.
p = P\left(F_{\hat{\varepsilon}(k - 1),\; \hat{\varepsilon}(k - 1)(n - 1)} \ge F\right) =P(F_{1.60,\,36.80} \ge 5.02)= .017
df_1 = 1.60
df_2 = 36.80
p_{\text{uncorrected}} = .011
The degrees of freedom are .80 × 2 = 1.60 and .80 × 46 = 36.80. The chance that F lands at or above 5.02 is .017, about 1 in 58. Without the correction it would be .011.
-
9. Find Which Time Points Actually Differ
A significant F says the averages aren't all equal, not which ones differ. Compare each pair with a paired t-test on that pair's own changes, then correct the p-values so the chance of any false positive across the three stays at or below .05.
p^{\text{Holm}}_{(i)} = \max_{j \le i} \; \min\left\{1,\; (m - j + 1)\, p_{(j)}\right\} =3 \times .01648, \;\; 2 \times .0790, \;\; 1 \times .0817p_{\text{after} - \text{before}} = .049
p_{\text{midway} - \text{before}} = .158
p_{\text{after} - \text{midway}} = .158
p_{(j)} are the three raw p-values in order, and m is our 3 pairs. Before versus after, .01648 × 3 = .049. Before versus midway, .0790 × 2 = .158. Midway versus after, .0817 × 1 = .082, raised to .158 so it isn't smaller than the one before it.
Run It in Software
The code below reads the running example's data from data.csv; save it in the same folder you run the code from.
SPSS (version 30, as documented by IBM)
- SPSS wants one column per time point. Our file is long, so first use Data → Restructure → Restructure selected cases into variables, with
clientas the Identifier Variable andtimeas the Index Variable. You get one row per client with columnsafter,beforeandmidway. - Analyze → General Linear Model → Repeated Measures. Type
timeas the Within-Subject Factor Name, 3 as the Number of Levels, click Add, then Define. - Move
before,midwayandafterinto the three slots, in that order. - EM Means: move
timeinto Display Means for, check Compare main effects, and choose Bonferroni. - Options: check Descriptive statistics and Estimates of effect size, and click OK.
Or paste this syntax:
GLM before midway after /WSFACTOR=time 3 Polynomial /METHOD=SSTYPE(3) /EMMEANS=TABLES(time) COMPARE ADJ(BONFERRONI) /PRINT=DESCRIPTIVE ETASQ /CRITERIA=ALPHA(.05) /WSDESIGN=time.
Reading the Output
Read the tables in this order: the Means in Descriptive Statistics, then Mauchly's Test of Sphericity for the Greenhouse-Geisser epsilon, then the Greenhouse-Geisser row of Tests of Within-Subjects Effects (Partial Eta Squared, df, F and Sig.), then Pairwise Comparisons.
Mauchly's Test of Sphericity (Measure: MEASURE_1)
| Within Subjects Effect | Mauchly's W | Approx. Chi-Square | df | Sig. | Greenhouse-Geisser | Huynh-Feldt | Lower-bound |
|---|---|---|---|---|---|---|---|
| time | .750 | 6.331 | 2 | .042 | .800 | .850 | .500 |
Tests of Within-Subjects Effects (Measure: MEASURE_1)
| Source | Type III Sum of Squares | df | Mean Square | F | Sig. | Partial Eta Squared | |
|---|---|---|---|---|---|---|---|
| time | Sphericity Assumed | 768.000 | 2 | 384.000 | 5.020 | .011 | .179 |
| Greenhouse-Geisser | 768.000 | 1.600 | 480.026 | 5.020 | .017 | .179 | |
| Huynh-Feldt | 768.000 | 1.701 | 451.544 | 5.020 | .015 | .179 | |
| Lower-bound | 768.000 | 1.000 | 768.000 | 5.020 | .035 | .179 | |
| Error(time) | Sphericity Assumed | 3518.667 | 46 | 76.493 | |||
| Greenhouse-Geisser | 3518.667 | 36.798 | 95.621 | ||||
| Huynh-Feldt | 3518.667 | 39.119 | 89.948 | ||||
| Lower-bound | 3518.667 | 23.000 | 152.986 |
Every row has the same F; only the degrees of freedom, and so p, change. Report the Greenhouse-Geisser row: F(1.60, 36.80) = 5.02, p = .017. Lower-bound uses the smallest possible ε, 1/(k − 1) = .50, the most conservative correction; few report it. SPSS doesn't print generalized η²; compute it from the sums of squares, adding the Error row of Tests of Between-Subjects Effects (14451.333) to the denominator: 768 ÷ (768 + 14451.333 + 3518.667) = .04.
Pairwise Comparisons (Bonferroni)
| (I) time | (J) time | Mean Difference (I−J) | Std. Error | Sig. | 95% CI Lower | Upper |
|---|---|---|---|---|---|---|
| 1 | 2 | 4.000 | 2.176 | .237 | -1.619 | 9.619 |
| 1 | 3 | 8.000* | 3.092 | .049 | .016 | 15.984 |
| 2 | 3 | 4.000 | 2.197 | .245 | -1.672 | 9.672 |
Levels 1, 2 and 3 are before, midway and after. SPSS lists every pair twice, once in each direction; three rows are shown here. It also prints Multivariate Tests, the multivariate approach that doesn't assume sphericity (Wilks' Lambda = .775, F(2, 22) = 3.20, p = .060), and Tests of Within-Subjects Contrasts, where the linear trend is F(1, 23) = 6.69, p = .016. SPSS offers Bonferroni here but not Holm; for Holm, adjust the paired t-test p-values by hand as in step 9 of the Napkin Math.
Output laid out from this page's computed results, not captured from a live run; labels and layout may differ slightly in your version.
R
therapy <- read.csv("data.csv")
therapy$time <- factor(therapy$time, levels = c("before", "midway", "after"))
therapy$client <- factor(therapy$client)
# afex applies the Greenhouse-Geisser correction by default
library(afex)
fit <- aov_ez(id = "client", dv = "anxiety", within = "time", data = therapy,
anova_table = list(es = "pes"))
fit
# Which pairs differ: paired t-tests with a Holm correction.
# Rows are sorted by client, so each time point's scores line up by client.
pairwise.t.test(therapy$anxiety, therapy$time, paired = TRUE,
p.adjust.method = "holm")
Anova Table (Type 3 tests)
Response: anxiety
Effect df MSE F pes p.value
1 time 1.60, 36.80 95.62 5.02 * .179 .017
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘+’ 0.1 ‘ ’ 1
Sphericity correction method: GG
Pairwise comparisons using paired t tests
data: therapy$anxiety and therapy$time
before midway
midway 0.158 -
after 0.049 0.158
P value adjustment method: holm
The df column already carries the Greenhouse-Geisser correction. Leave out anova_table to get generalized η² (ges, .041) instead of partial η², and use summary(fit) for Mauchly's test and the Huynh-Feldt version. Base R's aov(anxiety ~ time + Error(client/time), data = therapy) gives the same F with the uncorrected df of 2 and 46.
Output laid out from this page's computed results, not captured from a live run; labels and layout may differ slightly in your version.
Python
import pandas as pd
import pingouin as pg
therapy = pd.read_csv("data.csv")
aov = pg.rm_anova(data=therapy, dv="anxiety", within="time", subject="client",
correction=True, detailed=True, effsize="np2")
print(aov.round(4).to_string())
# Which pairs differ: paired t-tests, Holm-corrected
post = pg.pairwise_tests(data=therapy, dv="anxiety", within="time",
subject="client", padjust="holm")
print(post[["A", "B", "T", "dof", "p-unc", "p-corr"]].round(4).to_string())
Source SS DF MS F p-unc p-GG-corr np2 eps sphericity W-spher p-spher
0 time 768.0000 2 384.0000 5.0201 0.0107 0.0171 0.1792 0.8 False 0.7499 0.0422
1 Error 3518.6667 46 76.4928 NaN NaN NaN NaN NaN NaN NaN NaN
A B T dof p-unc p-corr
0 after before -2.5872 23.0 0.0165 0.0494
1 after midway -1.8208 23.0 0.0817 0.1580
2 before midway 1.8381 23.0 0.0790 0.1580
p-GG-corr is the Greenhouse-Geisser p and eps its ε; the DF column stays uncorrected, so multiply 2 and 46 by ε for the report. W-spher and p-spher are Mauchly's test. Pingouin sorts the time points alphabetically, so each pair reads as A minus B. Leave out effsize="np2" to get generalized η² (ng2, 0.041) instead.
Output laid out from this page's computed results, not captured from a live run; labels and layout may differ slightly in your version.
Impact
Effect Size
Generalized eta squared (η²G) expresses the result as the share of all the variation in the outcome that lines up with the condition, stable differences between people included. That's how a between-subjects η² counts variation too, so η²G is far more comparable across designs than η²p (Olejnik & Algina, 2003; Bakeman, 2005). More comparable isn't interchangeable: it still depends on which conditions were chosen and how varied the sampled people are. Like any η², it doesn't grow with sample size the way F does.
Counting how much clients differ from one another, 4% of all the variation in anxiety ratings lines up with time point, a small effect by convention. It's also exactly the η² a between-subjects ANOVA would give for the same scores.
SPSS prints partial eta squared (η²p) instead, and many readers expect it. It leaves the differences between people out of the denominator:
Of the ups and downs within each client's own three ratings, 18% line up with the time point. It looks more than four times bigger than η²G only because it ignores the biggest thing in the data: how differently afraid the clients were to begin with.
That's why η²p from a repeated-measures design can't be compared with a between-subjects η², or held against Cohen's benchmarks: the same means give a much bigger η²p when people are measured repeatedly (Lakens, 2013). Report η²G as the effect size, and give η²p too, labeled, for readers who expect it. Even for η²G, Lakens calls the benchmarks a last resort; comparing with similar studies is better.
For the change readers care about, give its size in points: anxiety fell 8 points on the 0-to-100 scale from before to after, 13% of where clients started. That difference's 95% confidence interval, 1.60 to 14.40 points, is the study's interval estimate of the effect; an η² from 24 people would have a very wide interval of its own. Whether that's enough to let someone stay in a room with a spider is a clinical question, not a statistical one.
Benchmarks Generalized Eta Squared at a Glance
Statistical Significance
p answers one narrow question: if every condition's population mean were the same, how often would F, the spread of the condition means relative to the error variance, come out at least this large? Only a large F counts against the null, so p comes from one tail of the F distribution, but it responds to differences in any direction. When sphericity doesn't hold, the uncorrected p comes out too small, so read the corrected one. Below the conventional α = .05, the result is called statistically significant.
If the true averages were equal at every time point, an F of 5.02 or more would turn up about 1.7% of the time, judged against the Greenhouse-Geisser-corrected F distribution, roughly 1 in 58. Without it, p would be .011. Either way it's below .05, so it's significant.
p is not the probability that the null hypothesis is true, and it says nothing about how large the change is or which time points differ. That's what η² and the follow-up comparisons are for.
Benchmarks p at a Glance
Strength of evidence against the null hypothesis.
Power and Sample Size
Power is the chance that a study detects an effect that's really there. A real effect doesn't guarantee a significant result: with too few people, it can easily come out non-significant. Power depends on how big the true change is, how many people you have, how many conditions there are, α, and something between-subjects designs don't have: how strongly each person's scores correlate across conditions. The more stable people are, the more noise the design removes, and the more power it has.
The calculator below works the way G*Power's repeated-measures test does (Faul et al., 2007). It takes three guesses besides the number of people: Cohen's f, here the SD of the condition averages (dividing by the number of conditions, k, not k − 1) divided by the SD of scores within a condition; ρ, the average correlation between conditions; and ε, how far sphericity is expected to fail (1 when it holds). It shrinks the expected size of F under the effect (the noncentrality) and both df by ε, as the Greenhouse-Geisser correction shrinks the df.
Don't turn a repeated-measures partial η² into f for this calculator. Partial η² has already left out the differences between people, and ρ takes them out a second time: our η²p of .18 would become f = 0.47 and promise 80% power with just 7 clients, when the right f needs about 30. From a published study, work f out from the means and SDs, or use roughly √(η²G ÷ (1 − η²G)).
Suppose we expected averages of 62, 58 and 54 with scores that vary and correlate as our clients' ratings did. The averages' SD, dividing by the 3 time points rather than 2, is 3.27 (√(32 ÷ 3)), and the SD within a time point about 16.1, so f = 0.20; the average correlation between time points is .70, and ε about .80. With 24 clients, about 70% of studies would come out significant, so a study this size would miss an effect like ours about 3 times in 10. With 30 it's about 80%, and with 40 about 91%. If the true drop were half as big (62, 60, 58, f = 0.10), even 100 clients would find it only about 74% of the time. A simulation that drew pretend studies from our sample's own spreads and correlations and ran the corrected F test gave nearly the same answers: 70% at 24 clients, 78% at 30, 89% at 40.
The correlation matters a lot: with ρ = .50 instead of .70, 24 clients would give only about 47% power. Our observed values come from just 24 clients, so don't plan the next study from them alone, and remember that power for the F test isn't power for the pairwise comparisons, which is lower for any single pair.
Researchers usually aim for at least 80% power. Plan it before collecting data, using the smallest effect that would matter and a cautious guess at the correlation. Try it:
Other Info
Follow-Up and Post Hoc Tests
Planned Contrasts
- Planned Contrasts: Use when theory predicted a pattern before you collected data. Across time points, the natural prediction is a steady decline, a linear trend. In the exposure-therapy study it gives F(1, 23) = 6.69, p = .016, and the bend in the middle (the quadratic trend) is exactly 0, because the means fall 4 points each step.
Post Hoc Tests
- Holm Correction: The standard follow-up for comparing every pair: a paired t-test for each pair, using only that pair's difference scores, then a Holm correction across the three. It's step 9 of the Napkin Math. Only before versus after differed, p = .049; midway didn't differ reliably from either, both p = .158.
- Bonferroni Correction: What SPSS offers for pairwise comparisons in a repeated-measures design. It gives the same protection as Holm with less power. Here before versus after is again p = .049, and the other two pairs p = .237 and .245.
References
- Fisher, R. A. (1925). Statistical methods for research workers. Oliver and Boyd.
- Greenhouse, S. W., & Geisser, S. (1959). On methods in the analysis of profile data. Psychometrika, 24(2), 95–112. https://doi.org/10.1007/BF02289823
- Huynh, H., & Feldt, L. S. (1976). Estimation of the Box correction for degrees of freedom from sample data in randomized block and split-plot designs. Journal of Educational Statistics, 1(1), 69–82. https://doi.org/10.3102/10769986001001069
- Mauchly, J. W. (1940). Significance test for sphericity of a normal n-variate distribution. The Annals of Mathematical Statistics, 11(2), 204–209. https://doi.org/10.1214/aoms/1177731915
-
Blanca, M. J., Arnau, J., García-Castro, F. J., Alarcón, R., & Bono, R. (2023b). Repeated measures ANOVA and adjusted F-tests when sphericity is violated: Which procedure is best? Frontiers in Psychology, 14, 1192453.
https://doi.org/10.3389/fpsyg.2023.1192453
“Early simulation studies showed that the Mauchly test does not control Type I error under non-normality, and neither is it sensitive to small departures from sphericity” (Introduction)
“the F-statistic becomes more liberal as sphericity violation increases, whereas both F-HF and F-GG control Type I error” (Abstract)
-
Blanca, M. J., Arnau, J., García-Castro, F. J., Alarcón, R., & Bono, R. (2023a). Non-normal data in repeated measures ANOVA: Impact on Type I error and power. Psicothema, 35(1), 21–29.
https://doi.org/10.7334/psicothema2022.292
“RM-ANOVA is generally robust to non-normality when the sphericity assumption is met.” (Abstract, Conclusions)
-
Olejnik, S., & Algina, J. (2003). Generalized eta and omega squared statistics: Measures of effect size for some common research designs. Psychological Methods, 8(4), 434–447.
https://doi.org/10.1037/1082-989X.8.4.434
“Because research-design features can have a large effect on the estimated proportion of explained variance, the use of partial eta or omega squared can be misleading.” (Abstract)
“generalized eta and omega squared statistics, which provide estimates of effect size that are comparable across a variety of research designs” (Abstract)
-
Bakeman, R. (2005). Recommended effect size statistics for repeated measures designs. Behavior Research Methods, 37(3), 379–384.
https://doi.org/10.3758/BF03192707
“it provides comparability across between-subjects and within-subjects designs” (Abstract)
-
Lakens, D. (2013). Calculating and reporting effect sizes to facilitate cumulative science: A practical primer for t-tests and ANOVAs. Frontiers in Psychology, 4, 863.
https://doi.org/10.3389/fpsyg.2013.00863
“Although η2G can be compared against the benchmarks provided by Cohen (1988), this should only be done as a last resort” (Eta-squared in between and within-subjects comparisons)
“using these benchmarks when interpreting the η2p effect size in designs that include covariates or repeated measures is not consistent with the considerations upon which the benchmarks were based” (Eta-squared in between and within-subjects comparisons)
- Cohen, J. (1988). Statistical power analysis for the behavioral sciences (2nd ed.). Lawrence Erlbaum Associates.
- Holm, S. (1979). A simple sequentially rejective multiple test procedure. Scandinavian Journal of Statistics, 6(2), 65–70. https://www.jstor.org/stable/4615733
- Maxwell, S. E., Delaney, H. D., & Kelley, K. (2018). Designing experiments and analyzing data: A model comparison perspective (3rd ed.). Routledge. https://doi.org/10.4324/9781315642956
-
Faul, F., Erdfelder, E., Lang, A.-G., & Buchner, A. (2007). G*Power 3: A flexible statistical power analysis program for the social, behavioral, and biomedical sciences. Behavior Research Methods, 39(2), 175–191.
https://doi.org/10.3758/BF03193146
“the noncentrality parameter and the degrees of freedom of the F distribution can be multiplied by a correction factor ε” (p. 181)
- Cohen, J. (1973). Eta-squared and partial eta-squared in fixed factor ANOVA designs. Educational and Psychological Measurement, 33(1), 107–112. https://doi.org/10.1177/001316447303300111
- Pierce, C. A., Block, R. A., & Aguinis, H. (2004). Cautionary note on reporting eta-squared values from multifactor ANOVA designs. Educational and Psychological Measurement, 64(6), 916–924. https://doi.org/10.1177/0013164404264848
-
Muff, S., Nilsen, E. B., O'Hara, R. B., & Nater, C. R. (2022). Rewriting results sections in the language of evidence. Trends in Ecology & Evolution, 37(3), 203–210.
https://doi.org/10.1016/j.tree.2021.10.009
“we suggest language of evidence that allows for a more nuanced approach to communicate scientific findings as a simple and intuitive alternative to statistical significance testing” (Abstract)
Spot an error? Something still confusing? Tell us at support@statsforpsychology.com.