Tutorials › ANOVA › Common Errors in Repeated-Measures Analyses

Within-Subject Designs · Tutorial 430 of 595

Common Errors in Repeated-Measures Analyses

Learn how to preserve the subject-level structure of repeated data and use the correct model and error term when interpreting a repeated-measures analysis.

Intermediate 11 min read

What You'll Learn

  • Distinguish subjects, conditions, and repeated observations.
  • Explain why measurements from the same subject are not independent observations.
  • Identify how missing subject labels prevent valid within-subject comparisons.
  • Select the subject-by-condition residual, rather than subject variation, as the classical test denominator.
  • Check the assumptions that support the repeated-measures F test.

Why Repeated-Measures Errors Matter

In a repeated-measures study, each subject contributes a response under more than one condition. That structure is useful because subjects often differ in their overall response level. It also creates a responsibility: the analysis must retain which observations belong to the same subject. Treating every recorded value as if it came from a different person can give an incorrect estimate of uncertainty, even when the condition means themselves are calculated correctly.

Several errors are easy to make when arranging or analyzing these data. A row of measurements may be mistaken for several independent subjects; a data file may omit the identifier that links measurements; the number of subjects may be confused with the number of conditions; or the condition effect may be divided by a measure of subject variation instead of the appropriate residual variation. Each error changes the question the analysis answers.

The Model and Its Conditions

Let \(Y_{ij}\) be the response from subject \(i\) in condition \(j\), where \(i=1,\ldots,n\) indexes subjects and \(j=1,\ldots,k\) indexes conditions. In a complete one-factor repeated-measures design, every subject has one response in every condition. A standard model is

$$ Y_{ij}=\mu+\tau_j+b_i+\varepsilon_{ij}, \qquad \sum_{j=1}^{k}\tau_j=0. $$

Here \(\mu\) is the overall mean, \(\tau_j\) is the effect of condition \(j\), \(b_i\) represents subject \(i\)'s baseline departure from the overall mean, and \(\varepsilon_{ij}\) is the remaining subject-by-condition variation. The null hypothesis for the condition test is \(H_0:\mu_1=\cdots=\mu_k\), where \(\mu_j\) is the population mean response in condition \(j\); the alternative is that not all condition means are equal.

Model assumptions for the classical repeated-measures F test: The subject-level response vectors are independent across subjects. The model is appropriate for the study design, and the within-subject errors (or, equivalently for the condition test, the relevant within-subject contrasts) are normally distributed. For the usual unadjusted univariate F test with more than two conditions, the within-subject differences satisfy sphericity: every pairwise difference has the same population variance. Each subject is measured under each condition for the standard complete-data calculation. These assumptions concern the design and response structure; they are not established merely by obtaining an F statistic.

The crucial independence statement is independence between subjects, not independence between all recorded scores. Repeated scores from one subject are generally related. The subject effect \(b_i\) represents one important source of that relation: a subject who tends to have high responses may tend to have high responses in several conditions.

Error 1: Treating Repeated Observations as Independent

A common mistake is to enter all \(nk\) measurements into an ordinary independent-groups one-way ANOVA. That analysis treats the \(k\) scores from a subject as if they came from \(k\) unrelated people. It therefore ignores the shared subject baseline and uses a different residual term and degrees of freedom. The resulting test is not the repeated-measures test, even if it displays the same condition means.

Worked Example: The Independent-Groups Error Changes the Denominator

Suppose four hypothetical subjects each have a response measured under three conditions. The responses are:

SubjectCondition 1Condition 2Condition 3
A81011
B91013
C7910
D101212

The condition means are \(8.5,\ 10.25,\ 11.5\), and the grand mean is \(10.0833\). The condition sum of squares is

$$ SS_{\text{condition}} =4\left[(8.5-10.0833)^2+(10.25-10.0833)^2+(11.5-10.0833)^2\right] \approx18.1667. $$

If the 12 scores are incorrectly treated as independent, the within-condition sum of squares is \(5+4.75+5=14.75\). The purported degrees of freedom are \(12-3=9\), so the incorrect denominator mean square is \(14.75/9\approx1.6389\). This gives \(F\approx(18.1667/2)/1.6389=5.542\). The computation is arithmetically coherent for an independent-groups analysis, but that is not the design that produced these data: each subject appears in all three conditions.

For the repeated-measures analysis, the correct denominator is calculated after accounting for subject differences. The next worked example computes it. This example shows why “there are 12 scores” does not mean “there are 12 independent subjects.”

Error 2: Losing Subject Identity

The subject identifier is not a decorative column. It identifies which observations form a repeated set. A file containing a condition and a response but no subject ID may retain the condition means, yet lose the information needed to estimate within-subject variation. Matching observations by their current row order is not a valid repair unless that order is known to preserve the true subject correspondence.

Worked Example: Why Condition Lists Cannot Replace Subject Labels

Suppose four hypothetical subjects have scores \(8,9,7,10\) in Condition A and \(10,10,9,12\) in Condition B. With subject labels intact, the paired differences \(B-A\) are \(2,1,2,2\), with mean \(1.75\). Their sample variance is

$$ s_d^2=\frac{(2-1.75)^2+(1-1.75)^2+(2-1.75)^2+(2-1.75)^2}{4-1} =\frac{0.75}{3}=0.25. $$

Now suppose the two condition lists are kept but the subject labels are removed. The same B scores could be arbitrarily paired in the order \(10,12,10,9\), producing differences \(2,3,3,-1\). Their mean is still \(1.75\), but their sample variance is

$$ \frac{(2-1.75)^2+(3-1.75)^2+(3-1.75)^2+(-1-1.75)^2}{3} =\frac{10.75}{3}\approx3.583. $$

Both pairings preserve the same condition scores and means, but they imply very different within-subject variability. Only the original subject labels determine which pairing is genuine. Without them, the paired comparison and the repeated-measures residual cannot be recovered from the condition lists alone.

Error 3: Confusing Subjects with Conditions

The two indices in \(Y_{ij}\) have different roles. The index \(i\) identifies a subject; \(j\) identifies a condition. Thus \(n\) is the number of subjects and \(k\) is the number of conditions. A subject is not a condition simply because a data table has one row per subject, and the number of rows is not the number of treatment levels.

In a balanced, complete one-factor design, the degrees of freedom help expose this confusion. There are \(k-1\) degrees of freedom for condition, \(n-1\) for subjects, and \((n-1)(k-1)\) for the subject-by-condition residual. These add to the total \(nk-1\):

$$ (k-1)+(n-1)+(n-1)(k-1)=nk-1. $$

For four subjects and three conditions, the respective degrees of freedom are \(2,\ 3,\ 6\), which total \(11=12-1\). The condition degrees of freedom depend on the number of conditions, not on the number of subjects.

Error 4: Using the Wrong Residual Term

In the classical repeated-measures ANOVA, the condition test compares condition variation with the subject-by-condition residual variation. Subject-to-subject baseline variation is modeled separately. Dividing by subject variation instead answers a different question and can badly distort the test.

Key result: For a complete one-factor repeated-measures design, the classical condition statistic is \(F=MS_{\text{condition}}/MS_{\text{error}}\), where \(MS_{\text{error}}\) is the subject-by-condition residual mean square. Its degrees of freedom are \(k-1\) and \((n-1)(k-1)\), respectively, under the stated model assumptions.

The calculation follows from partitioning total variation into condition, subject, and residual components. For each subject, the response can be decomposed into an overall level, a condition departure, a subject departure, and what remains. In a balanced design these components are orthogonal in the sums-of-squares decomposition, so

$$ SS_{\text{total}} =SS_{\text{condition}}+SS_{\text{subjects}}+SS_{\text{error}}. $$

The condition mean square measures variation among condition means. The residual mean square estimates the relevant within-subject variation left after condition and subject baselines are accounted for. Subject variation is not the correct denominator because it measures differences in overall levels between people, not unexplained changes across conditions within people.

Worked Example: Calculating the Correct Repeated-Measures F Statistic

Use the hypothetical four-subject, three-condition table above. The subject means are \(9.6667,\ 10.6667,\ 8.6667,\ 11.3333\). The subject sum of squares is

$$ SS_{\text{subjects}} =3\left[(9.6667-10.0833)^2+(10.6667-10.0833)^2 +(8.6667-10.0833)^2+(11.3333-10.0833)^2\right] =12.25. $$

The total sum of squares can be calculated from the sum of squared scores, \(1253\), and the correction term \(121^2/12\):

$$ SS_{\text{total}}=1253-\frac{121^2}{12}\approx32.9167. $$

Therefore \(SS_{\text{error}}=32.9167-18.1667-12.25=2.5\). The degrees of freedom are \(df_{\text{condition}}=3-1=2\), \(df_{\text{subjects}}=4-1=3\), and \(df_{\text{error}}=(4-1)(3-1)=6\). Thus

$$ MS_{\text{condition}}=\frac{18.1667}{2}=9.08335,\qquad MS_{\text{error}}=\frac{2.5}{6}=0.416667, \qquad F=\frac{9.08335}{0.416667}\approx21.8. $$

For \(F(2,6)=21.8\), the upper-tail p-value is approximately \(0.00177\). Under the model assumptions, this is strong evidence that the three population condition means are not all equal. It is not evidence that every pair of conditions differs. The calculation presumes the assumptions stated earlier; this small hypothetical table alone cannot establish normality or sphericity. If, incorrectly, the subject mean square \(12.25/3\approx4.0833\) were used as the denominator, the result would be \(9.08335/4.0833\approx2.224\), a test based on the wrong source of variation.

Practical Checks Before Reporting Results

A useful review begins with the design rather than the software output. Confirm that each row or record can be linked to a subject and a condition, and that repeated observations are not counted as independent people. Verify that \(n\) and \(k\) are being used for subjects and conditions, respectively. Then check that the reported denominator and its degrees of freedom correspond to the repeated-measures residual.

Also consider the assumptions before treating the classical F reference distribution as appropriate. Independent subject vectors are a design-level requirement; repeated values within a subject are not expected to be independent. Normality concerns within-subject errors or contrasts, and sphericity is required for the usual unadjusted test with more than two conditions. A data-format correction cannot make a design satisfy an assumption, and a significant test does not validate the assumptions.

Common mistake: “There are three measurements per person, so I can treat the three columns as three independent groups.” The correction is to preserve subject membership and analyze each person’s set of responses as repeated observations. Similarly, “the subjects vary a lot, so subject variation should be the error denominator” is wrong: the condition test uses the residual after subject baselines are accounted for.

Key takeaway: Repeated-measures analysis depends on matching observations to the subjects who produced them. Keep the subject and condition roles distinct, and use the subject-by-condition residual—not the subject mean square—as the denominator for the classical condition F test.

Check Your Understanding

Answer each question by referring to the design structure, not just the appearance of the data table.

  1. A study measures each of 18 participants under four conditions. What do \(n\) and \(k\) represent, and how many total scores are recorded if there are no missing values?
  2. Why is independence across subjects different from independence across all recorded scores?
  3. Two condition score lists have the same means, but their subject identifiers have been lost. What important information needed for a repeated-measures analysis may no longer be recoverable?
  4. For a complete design with \(n=6\) subjects and \(k=3\) conditions, state the condition, subject, and residual degrees of freedom.
  5. Explain why the subject mean square is not the denominator for the classical condition F test.
Clinical Biostats