Reproducible analysis template
Purpose
This workflow analyzes the same repeated outcome with three
frameworks: repeated-measures ANOVA, a multivariate test of change
contrasts, and a linear mixed-effects growth model. The comparison
clarifies how assumptions, missing data, time coding, and the research
question affect the analysis.
The included longitudinal data are entirely synthetic.
The methods are related but not interchangeable. Select a framework from
the design, time structure, estimand, and assumptions rather than from
which produces the smallest p-value.
How the frameworks differ
| Repeated-measures ANOVA |
Categorical occasions |
Direct omnibus mean comparison |
Complete cases and covariance assumptions |
| Multivariate approach |
Vector of repeated outcomes or contrasts |
Avoids sphericity |
Complete cases; more parameters |
| Growth model |
Numeric or flexible time function |
Individual trajectories and incomplete schedules |
Requires random-effects and covariance decisions |
User settings
Simulate and import the example
Rows: 960
Columns: 5
$ student_id <chr> "R001", "R001", "R001", "R001", "R002", "R002", "R002", "R0~
$ program <fct> Standard, Standard, Standard, Standard, Standard, Standard,~
$ month <dbl> 0, 6, 12, 18, 0, 6, 12, 18, 0, 6, 12, 18, 0, 6, 12, 18, 0, ~
$ score <dbl> 50.8, 45.5, 48.4, 46.1, 56.4, 60.4, 53.1, 67.5, 45.5, 54.2,~
$ time <dbl> 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3,~
Data audit
| Students imported |
240 |
| Complete repeated-measures profiles |
177 |
| Students contributing to growth model |
240 |
| 0 |
240 |
221 |
19 |
7.9 |
| 6 |
240 |
225 |
15 |
6.2 |
| 12 |
240 |
222 |
18 |
7.5 |
| 18 |
240 |
222 |
18 |
7.5 |
The ANOVA and multivariate demonstrations use complete profiles. The
mixed model uses every observed outcome under its likelihood
assumptions. Neither choice repairs data that are missing not at
random.
Describe repeated outcomes
Means and covariance
| 0 |
221 |
50.61 |
8.06 |
0.54 |
49.54 |
51.67 |
| 6 |
225 |
53.99 |
8.22 |
0.55 |
52.91 |
55.07 |
| 12 |
222 |
56.21 |
8.35 |
0.56 |
55.11 |
57.32 |
| 18 |
222 |
57.89 |
9.21 |
0.62 |
56.68 |
59.11 |
| score_m0 |
64.97 |
51.48 |
49.49 |
54.33 |
| score_m6 |
51.48 |
67.52 |
51.44 |
56.78 |
| score_m12 |
49.49 |
51.44 |
69.79 |
61.45 |
| score_m18 |
54.33 |
56.78 |
61.45 |
84.81 |
Individual and mean trajectories

Repeated-measures ANOVA
| 3 |
528 |
109.277 |
0 |
0.689 |
2.066 |
363.648 |
0 |
This omnibus test asks whether occasion means are equal among
complete profiles. The Greenhouse-Geisser epsilon summarizes departure
from sphericity and is used here to correct the numerator and
denominator degrees of freedom. Report the corrected p-value when
epsilon is meaningfully below 1. The multivariate and mixed-model
analyses provide alternatives with different assumptions and
estimands.
Multivariate test of change
The one-sample Hotelling test is a repeated-measures multivariate
test of whether the vector of successive mean changes equals zero. It
avoids sphericity but still needs complete profiles, multivariate
assumptions, and adequate sample size relative to the number of
contrasts.
Quadratic growth model
| (Intercept) |
49.404 |
0.697 |
647 |
70.914 |
0.000 |
48.036 |
50.772 |
| time |
3.764 |
0.453 |
647 |
8.318 |
0.000 |
2.876 |
4.653 |
| I(time^2) |
-0.521 |
0.135 |
647 |
-3.854 |
0.000 |
-0.786 |
-0.255 |
| programEnhanced |
2.361 |
0.983 |
238 |
2.401 |
0.017 |
0.424 |
4.299 |
| time:programEnhanced |
0.489 |
0.293 |
647 |
1.671 |
0.095 |
-0.086 |
1.064 |
student_id = pdLogChol(time)
Variance StdDev Corr
(Intercept) 45.445895 6.741357 (Intr)
time 1.589124 1.260605 0.088
Residual 15.537890 3.941813
Time is centered at baseline and one unit represents 6 months. The
time coefficient is therefore the instantaneous linear component at
baseline; the quadratic term allows the rate of change to bend over
follow-up.
Model-predicted trajectories

Growth-model diagnostics

Also review the random-effects distribution, within-person
covariance, influential students, nonlinear time alternatives, and
missing-data assumptions. More flexible covariance structures require
enough repeated observations to estimate reliably.
Dynamic results template
Repeated outcomes were available for 240 synthetic students across 4
scheduled occasions. The repeated-measures ANOVA included 177 complete
profiles and, after the Greenhouse-Geisser correction (epsilon = 0.69),
provided evidence that at least one occasion mean differed, F(2.07,
363.65) = 109.28, p < .001. A multivariate Hotelling test of the
successive change vector produced T-squared = 258.48, approximate F(3,
174) = 85.18, p < .001.
The mixed-effects growth model used 890 observed scores from 240
students. At baseline, the estimated 6-month linear component was 3.76
points, 95% CI [2.88, 4.65], p < .001. The quadratic coefficient was
-0.52, 95% CI [-0.79, -0.26], p < .001, supporting curvature over the
observed period. The enhanced-program linear component differed from the
standard-program component by 0.49 points per 6 months, 95% CI [-0.09,
1.06], p = .095. These frameworks use different estimation samples and
target different summaries, so their results should be interpreted
within their own assumptions rather than treated as interchangeable
tests.
Reporting checklist
- State the number, timing, and coding of repeated occasions.
- Report the analysis sample used by each framework and the
missing-data approach.
- Describe covariance or sphericity assumptions and any
corrections.
- Define the growth model’s time origin, time unit, fixed effects, and
random effects.
- Present estimated means or trajectories with uncertainty.
- Explain why the chosen framework answers the research question.
Exports
| synthetic_repeated_measures_wide.csv |
| synthetic_repeated_measures_long.csv |
| wave_descriptives.csv |
| repeated_measures_anova.csv |
| multivariate_change_test.csv |
| growth_model_fixed_effects.csv |
| growth_model_predictions.csv |
References
- Gueorguieva, R., & Krystal, J. H. (2004). Move over ANOVA:
Progress in analyzing repeated-measures data. Archives of General
Psychiatry, 61(3), 310–317.
- Singer, J. D., & Willett, J. B. (2003). Applied Longitudinal
Data Analysis. Oxford University Press.
Paid version: The download includes all editable R
code, the synthetic-data generator, documented outputs, and complete
software-version details.