The short answer
Choose from the design and missingness—not the smaller P value.
Repeated-measures ANOVA
A complete, balanced subject-by-condition table
Every included subject needs an observation at every condition. The usual univariate test also needs a defensible covariance assumption, with Greenhouse–Geisser or another correction when sphericity is not assumed.
Mixed-effects model
Observed cells can contribute without a complete row
A likelihood-based mixed model can use unequal observation counts. Its validity still depends on the specified fixed effects, random effects, covariance structure and a defensible explanation for why values are missing.
One real missing value, not a simulated blank
R's ChickWeight dataset records chick body weight
over time under four diets. This example keeps Diet 1, chicks
1–8, and five ages. Chick 8 has no recorded day-21 weight in the
source data, leaving 39 observed cells out of 40.
| Chick | Day 0 | Day 6 | Day 12 | Day 18 | Day 21 |
|---|---|---|---|---|---|
| 1 | 42 | 64 | 106 | 171 | 205 |
| 2 | 40 | 72 | 122 | 187 | 215 |
| 3 | 43 | 67 | 115 | 187 | 202 |
| 4 | 42 | 67 | 102 | 154 | 157 |
| 5 | 41 | 60 | 141 | 199 | 223 |
| 6 | 41 | 74 | 141 | 160 | 157 |
| 7 | 41 | 71 | 146 | 250 | 305 |
| 8 | 42 | 71 | 110 | 134 | — |
What complete-case RM ANOVA does
Repeated-measures ANOVA requires complete rows, so chick 8 is excluded from every age—not only from day 21. The analysis uses 7 subjects and 35 observations. It gives F(4, 24) = 68.944, uncorrected P = 8.35 × 10−13. Greenhouse–Geisser ε = 0.302, giving corrected P = 4.26 × 10−5.
Complete-case means are 41.43, 67.86, 124.71, 186.86 and 209.14 g. Dropping chick 8 therefore removes its four observed early measurements and changes the first four descriptive means. This is a consequence of the complete-block analysis, not a software error.
What this mixed-effects model does instead
Plotwright's one-way repeated mixed model treats age as a categorical fixed effect, includes a random intercept for each chick and fits by restricted maximum likelihood. It uses all 8 chicks and all 39 observed weights. The fixed age effect gives Wald χ²(4) = 281.946, P = 8.48 × 10−60.
| Age | Observed n | Observed mean (g) |
|---|---|---|
| Day 0 | 8 | 41.50 |
| Day 6 | 8 | 68.25 |
| Day 12 | 8 | 122.88 |
| Day 18 | 8 | 180.25 |
| Day 21 | 7 | 209.14 |
The result answers whether the categorical age coefficients are jointly zero under this random-intercept model. It is not an exact re-expression of the RM ANOVA F test, and a Wald test can be optimistic in small samples. Eight chicks are useful for teaching the mechanics, not for a definitive growth study.
Keeping data does not solve missingness
A likelihood analysis is commonly justified when missingness is ignorable under the specified model—for example, missing at random after conditioning on observed information. It does not neutralize informative dropout. If a chick is missing because its unobserved weight or health determined whether it was measured, neither this simple model nor complete-case ANOVA can establish an unbiased biological effect by itself.
A practical decision checklist
- Identify the experimental unit and preserve subject IDs.
- Plot individual trajectories before fitting either model.
- Tabulate missing cells by condition and explain likely causes.
- Pre-specify the fixed effects and covariance/random-effects structure.
- Do not delete an incomplete subject merely to make the table rectangular.
- Report which observations each analysis used and run a sensitivity analysis when missingness could be informative.
Two transparent reporting templates
Complete-case RM ANOVA: “Weight differed across five ages by repeated-measures ANOVA with Greenhouse–Geisser correction, F(4, 24) = 68.944, ε = 0.302, corrected P = 4.26 × 10−5. Seven complete chicks were analyzed; one chick with a missing day-21 measurement was excluded at all ages.”
Random-intercept mixed model: “All 39 observed weights from eight chicks were fitted by REML with categorical age as a fixed effect and chick as a random intercept. The joint age effect was Wald χ²(4) = 281.946, P = 8.48 × 10−60. One day-21 value was missing; the missingness mechanism could not be established from the dataset.”
What the executable checks establish
The same 39 visible values run through both production paths in
the automated suite. A direct reference-library
AnovaRM fit reproduces the complete-case F
statistic, and a direct MixedLM fit reproduces the
Wald term. The two editable routes contain the same table and
differ only in the preselected analysis.
Those checks establish numerical consistency for these model specifications. They cannot identify why chick 8 lacks a value, validate the covariance model, justify treating age as categorical or turn this subset into evidence about diet.
Sources and reproducibility
- R datasets documentation: ChickWeight—study context, variables, ages and diet groups.
- Guidelines for repeated-measures analysis in basic science—design assumptions, missing-data consequences and mixed-model considerations.
- statsmodels linear mixed-effects documentation—the reference-library implementation called directly in the numerical cross-check.
- Plotwright statistical validation—published expected values, tolerances and evidence boundaries for the broader engine.