One-Way Repeated-Measures ANOVA

Canonical reference: Maxwell, Delaney, & Kelley (MDK) ref/mdk

In the independent-groups design of one-way ANOVA, each condition is administered to a separate group of participants, and condition differences are judged against the variability among individuals within conditions. A within-subjects or repeated-measures design instead assigns every participant to every condition, so each condition mean is computed from the same people. Because the same participants recur in every condition, their scores are correlated — a participant who scores high in one condition tends to score high in the others — and the analysis has to account for that structure rather than ignore it.

The central idea is to split what a between-subjects analysis would lump together as error into two parts: systematic differences among participants’ overall levels, and the remaining inconsistency of condition effects across participants. The first part is removed from the error term; only the second serves as the yardstick against which condition differences are judged.

Within-subjects designs and correlated scores

This page treats a single within-subjects factor. Let be the number of participants, the number of conditions, and the total number of scores. Write for the score of participant in condition , with and . The data form an table — participants in rows, conditions in columns — that resembles a two-way layout but holds a single score in each cell, the rows being a classification of participants rather than a second manipulated factor. Unlike a between-subjects layout, where each row is a different person, the same participant identifiers recur in every column. Three means attach to the table: the condition mean , the average of column over the participants; the participant mean , the average of row over the conditions; and the grand mean , the average of all scores.

The running example is a hypothetical caffeine study. Ten participants () each took a capsule at 3 p.m. on four nights spaced one week apart, the capsule containing a placebo ( mg) or , , or mg of caffeine ( conditions), and a sleep tracker recorded nightly sleep duration in hours:

Participant0 mg100 mg200 mg400 mg
1810757.50
299868.00
375846.00
496576.75
587767.00
654434.00
776545.50
888667.00
998657.00
1077455.75
Condition mean 7.707.006.005.106.45

The bottom-right entry is the grand mean. The participant means range from 4.00 to 8.00 hours, and the participants with high overall means tend to sit above their condition means in every column while those with low overall means sit below in every column. Stable characteristics of the person push scores in the same direction across conditions, which is exactly why scores in different conditions are correlated.

Because each participant supplies a score in every condition, comparisons between conditions are within-person: every participant acts as their own control, and systematic between-person differences do not contaminate the comparison. This can gain precision and statistical power and can reduce the number of participants a study requires. These are potential advantages of the design, not guarantees; the size of the gain depends on how much stable between-person variability there is to remove, as the bookkeeping later in this page makes precise.

Condition, participant, and residual variability

Total variability splits into three sources: differences among condition means (), differences among participants’ overall means (), and the remaining variability, the departures from the combined condition-plus-participant pattern (). The partition is exact:

with the caffeine values , where

Condition variability. The condition means deviate from the grand mean by , , , and , and the sum of their squares is . Each condition mean summarizes scores, so squared deviations of condition means are weighted by :

Participant variability. The participant mean summarizes a participant’s overall level, and differences among these means are the stable individual differences the design wants to isolate. is computed by the same procedure as with rows in place of columns:

  1. Compute each participant’s mean .
  2. Subtract the grand mean from each.
  3. Square the deviations.
  4. Sum the squared deviations over participants; here .
  5. Multiply by , the number of scores behind each participant mean:

As a check, participant 1 alone contributes .

Residual variability. The remainder follows by subtraction, , and can also be computed directly from the residuals of the additive pattern:

The residual is the part of a score that neither the condition pattern nor the participant’s overall level predicts. It has two conceptually distinct origins: genuine participant-by- condition variation — different participants responding differently to the conditions — and measurement or occasion-specific error. With one score per participant-condition cell the two cannot be separated; whatever its origin, every departure from the combined pattern lands in .

The connection to the between-subjects partition is a single identity. A one-way ANOVA that ignored the pairing would use as its error the within-condition sum of squares

which equals for the caffeine data and splits exactly as , here . A between-subjects analysis therefore leaves the participant source sitting inside its error term; removing it is what distinguishes the repeated-measures partition.

What each source responds to. Adding a constant to one participant’s row shows what the participant source captures. If participant 1 had slept one hour more in every condition, would rise from to and from to , while and would not change at all: every condition mean and the grand mean move by the same hour, which cancels in the condition deviations and in the residual formula. A participant who generally sleeps longer across all doses is captured by the participant source — precisely the source this design removes from the error term.

Why the participant-by-condition denominator

The condition effect is an average of differences: each participant supplies a difference between conditions, and the analysis averages them. The appropriate yardstick is the consistency of those differences across participants — a condition difference is convincing when it is large relative to the variability of participants’ condition differences, which is what estimates. Variability among participants’ overall levels is irrelevant to that question, and the design removes it.

Profile plots make the point visible. A profile plot puts the conditions on the horizontal axis, the outcome on the vertical axis, and draws one line per participant connecting that participant’s scores. Consider two datasets with the same size as small examples, participants and conditions, both with condition means exactly , , , — hence the same — and radically different residuals. In one dataset the five profiles are nearly parallel: every participant shows close to the same drop between adjacent conditions, , and . In the other the profiles crisscross: participants’ condition differences point in different directions, , and the very same condition means yield only , . Identical means and identical numerator; the denominator alone decides what the data support.

The mirror-image sensitivity experiment adds a constant to one condition. If every participant had slept two hours more in the 400 mg condition only, would fall from to and from to , while and would remain exactly as they were: each participant’s mean moves by the same hour, which cancels from the participant deviations and from every residual. A uniform shift within one condition moves only the condition source and the total — it cannot masquerade as a participant difference or as inconsistency of the condition effects.

The unadjusted omnibus F test

With population condition means , the omnibus hypotheses parallel the between-subjects case:

Each mean square is a sum of squares divided by its degrees of freedom, and the test statistic compares the condition mean square to the participant-by-condition mean square:

The degrees of freedom partition alongside the sums of squares:

SourceCaffeine
Conditions3
Participants9
Error ()27
Total39

The error degrees of freedom can be read either in product form, , or as the total df minus the condition and participant df, . The computations are conventionally organized in a summary table:

Source
Conditions38.90312.9712.24
Participants48.4095.38
Error ()28.60271.06
Total115.9039

Sums of squares and degrees of freedom add down the table. The participant row carries no : the omnibus question concerns conditions, and this partition supplies no error term against which participant differences would be tested. The row in this table labeled error is the participant-by-condition source; the names these rows carry across textbooks and software are aligned in the crosswalk of ANOVA quantities.

For the caffeine data,

which exceeds the critical value (). Using this unadjusted reference distribution, the null hypothesis of equal condition means is rejected: the data provide evidence that sleep duration is not the same across the four caffeine doses. Which doses differ from which is a question the omnibus test does not answer; locating differences requires targeted within-person comparisons of the kind developed in Repeated-Measures Comparisons.

What removing the participant source buys

How much was gained by removing from the error term? A between-subjects one-way ANOVA of the same 40 scores would judge the same against , giving . The repeated-measures test judges that numerator against and reaches — larger, by a factor of . Because both statistics use the same scores, the comparison is exact bookkeeping, and it runs in both directions.

When the two error sums of squares coincide, since , but the degrees of freedom do not: the repeated-measures error has df against the between-subjects , so the same error sum of squares is spread over fewer df and the repeated-measures error mean square is larger by exactly the factor . With identical numerators,

On the crossing-profile dataset above, built with : the repeated-measures test gives () while the between-subjects statistic on the same scores is () — smaller by exactly . Zero participant variability therefore does not make the two tests identical: the error sums of squares match while the error degrees of freedom differ.

In general, whenever the two statistics stand in the ratio

so exactly when : writing the ratio as exceeding 1 gives , and dividing both sides by turns that into the comparison of the two mean squares. Removing the participant source from the error pays for the degrees of freedom it costs precisely when participants’ overall levels vary more, per degree of freedom, than their condition effects are inconsistent. For the caffeine data far exceeds , and the repeated-measures statistic is the larger one.

Two qualifications keep the comparison honest. First, these are degrees-of- freedom and mean-square identities computed on one set of scores viewed both ways — not a recommendation. A between-subjects applied to dependent scores assumes independent errors the design does not provide, and neither statistic should be chosen because it happens to be larger. Second, the ratio identities require nonzero error terms and . If , the repeated-measures error mean square is zero and its is undefined; the between-subjects statistic need not be undefined, because leaves its error mean square positive. If and both error terms are nonzero, both statistics equal zero and coincide.

Two conditions: equivalence with the paired t test

With conditions the design collapses to the paired-samples setting. Each participant contributes one difference score,

and the null hypothesis of equal condition means is the null hypothesis that the population mean difference is zero. The natural statistic is the paired on the difference scores, whose mechanics — standard error, degrees of freedom, two-sided decision — are those of the paired-samples test. The repeated-measures with two conditions is the square of that :

As a compact check, five participants each rated their mood after listening at a slow and a medium tempo. The medium-minus-slow difference scores are , with mean , variance , and standard error , giving

A repeated-measures ANOVA of the same two conditions gives , and the two procedures return identical p-values (). The equivalence is exact; the repeated-measures framework adds nothing until .

Full and restricted models

The test can be restated as a comparison of two nested models, instantiating the generic model-comparison machinery. The full model gives every condition and every participant its own additive effect:

where is the grand level, the effect of condition , the effect of participant , and the error. The restricted model drops the condition effects — the restriction is precisely the omnibus null — but keeps the participant effects:

Least-squares estimation gives

so the fitted values are

The full model predicts a score from the condition mean and the participant mean together, the grand mean subtracted once because both already include it; the restricted model predicts each participant’s scores by that participant’s own mean. The estimates satisfy and , which is why only condition effects and participant effects are free.

As a compact illustration of the arithmetic, suppose a condition mean is , a participant’s mean is , the grand mean is , and the observed score is . The full-model prediction is , equivalently , and the residual is — the observed score less both means, with the grand mean added back.

For participant 1 of the caffeine data, :

Component0 mg100 mg200 mg400 mg
6.456.456.456.45
Full prediction 8.758.057.056.15

The restricted model predicts hours in every condition for this participant. Neither model fits exactly, and the residuals — observed minus predicted — are what the error sums accumulate.

The error sums of squares follow directly. The full model’s error is the sum of squared participant-by-condition residuals, . The restricted model’s error is

so allowing condition effects reduces the error by exactly .

Degrees of freedom are counts of scores minus parameters estimated. The restricted model estimates parameters — and the independent — so . The full model estimates parameters — , the independent , and the independent — so . Their difference is , the degrees of freedom of the tested restriction. The model-comparison statistic is then

identical to the ANOVA-table : the classic partition and the model comparison are two computations of one test.

Effect sizes

The omnibus test asks whether the condition means differ, not how large their differences are. Effect sizes summarize magnitude, but their denominators must be stated explicitly because participant variability can either remain in the scaling or be removed from it. General principles are treated in Effect Sizes; the formulas here are specific to the present one-way within-subjects partition.

Ordinary and partial eta-squared

Two proportions use different denominators:

Ordinary eta-squared describes the condition sum of squares as a proportion of the total sum of squares, including both participant and residual variability. Partial eta-squared instead compares condition variability with condition plus the participant-by-condition residual. It leaves overall participant differences out of the denominator, paralleling their removal from the error term of the repeated-measures test.

For the hypothetical caffeine data,

whereas

Thus is not the proportion of total variability associated with condition; that descriptive proportion is . Neither measure is altered by a Greenhouse–Geisser or Huynh–Feldt correction, because those corrections leave all sums of squares unchanged.

Standardized mean differences

A standardized condition difference also requires a declared standardizer. One convention, intended to aid comparison with between-subjects designs, retains overall participant variability and the participant-by-condition residual:

Here is the within-condition sum of squares when pairing is ignored, and is its degrees of freedom. For the placebo-minus-400 mg difference, this standardizer gives

A different convention standardizes by the SD of the pairwise difference scores. For , the hypothetical data give and , so the difference-score standardized effect defined in Effect Sizes is

The values and are not competing calculations of one quantity: they scale the same mean difference by different standard deviations. Reports should therefore name the standardizer rather than merely label either value “Cohen’s .” Retaining participant variability is intended to facilitate comparison across designs; it does not make effect sizes from different studies automatically comparable.

Reporting the analysis

A report should connect the omnibus inference, its covariance correction, and the targeted comparisons without treating any one of them as answering the others’ questions. It should identify:

  • the one-way repeated-measures design and any correction used;
  • the observed , the reference degrees of freedom used for inference (corrected when applicable), the p-value, and a named omnibus effect size;
  • the follow-up procedure and the family over which it controls error; and
  • the directions and raw-unit magnitudes of important differences, with simultaneous intervals when familywise inference is used.

For example, the hypothetical caffeine analysis can be summarized by a Greenhouse–Geisser-corrected , , . In a Bonferroni family containing all six pairwise comparisons, sleep duration was lower at 200 mg and 400 mg than at placebo, and lower at 400 mg than at 100 mg. The largest observed pairwise difference was placebo minus 400 mg: 2.60 hours, with a 95% familywise interval of hours. The three adjacent-dose nulls were not rejected; those nonrejections do not establish equivalence. The corrections are developed in Repeated-Measures Assumptions and Corrections, and the full comparison-specific calculations appear in Repeated-Measures Comparisons.

Scope and downstream topics

This page owns the within-subjects notation, the partition, the unadjusted omnibus test, the participant-augmented model comparison, and repeated-measures omnibus effect sizes. Three further questions arise, and each has a canonical page:

  • Can the unadjusted reference distribution be trusted? Repeated-Measures Assumptions and Corrections explains when it is appropriate and how epsilon corrections change its degrees of freedom.
  • Which conditions differ? Repeated-Measures Comparisons locates condition differences with pairwise and complex contrast scores and comparison-specific error estimates.
  • What do order, carryover, time, and incomplete observations imply for the design and its interpretation? Repeated-Measures Design Considerations treats these issues alongside the choice between within- and between-subjects designs.

The generic contrast and familywise-error machinery used by those applications remains in Linear Contrasts and Multiple Comparisons.

Repeated-measures-specific power and sample-size formulas remain outside the present scope. Within-person comparison can improve precision and power, but the design does not guarantee a universal power advantage.

  • Repeated-Measures Assumptions and Corrections develops sphericity, Mauchly’s test, and Greenhouse–Geisser and Huynh–Feldt corrections.
  • Repeated-Measures Comparisons supplies pairwise and complex within-person tests and simultaneous intervals.
  • Repeated-Measures Design Considerations covers order, counterbalancing, carryover, and longitudinal design limits.
  • One-way ANOVA develops the between-subjects counterpart, its / partition, and the meaning of the omnibus question.
  • Model comparison owns the generic full-versus-restricted machinery that this page instantiates with participant-augmented models.
  • Linear contrasts covers targeted comparisons of means, whether planned in advance or used to localize an omnibus result.
  • t tests treats the paired-samples design whose two-condition repeated-measures analysis is the squared paired .
  • Crosswalk of ANOVA quantities aligns the errors, sums of squares, and degrees of freedom across naming traditions.