Repeated Measures ANOVA: Assumptions, Steps, and ANCOVA

Repeated measures ANOVA tests whether mean outcomes differ across three or more conditions or time points when the same participants contribute to every one of them. Because each person serves as their own control, the test removes stable between-person differences from the error term and gains sensitivity. It also comes with a strict set of assumptions (sphericity above all), and it breaks down when observations are missing. This guide covers when to use it, how to check it, how to report it, and how it compares with ANCOVA, MANOVA and mixed-effects models.
TL;DR
- Use repeated measures ANOVA (also called within-subjects ANOVA) when the same units are measured under three or more conditions or at three or more times. With two conditions, a paired t-test does the same job.
- Check sphericity with Mauchly’s test and apply a Greenhouse-Geisser or Huynh-Feldt correction when it fails. Report partial eta squared alongside the F statistic.
- Repeated measures ANOVA drops any participant with a missing measurement. If you have dropout or unequal timing, a mixed-effects model is usually the better choice.
- ANCOVA compares groups on a final value while adjusting for a covariate such as baseline. With a pretest and posttest, it is often more powerful than analyzing change scores.
Table of Contents
- What repeated measures ANOVA does
- When to use it: one-way, two-way, and mixed designs
- Assumptions of repeated measures ANOVA
- Running and reading the analysis
- Missing data and when to move to a mixed model
- ANOVA vs. ANCOVA
- Type II vs. Type III sums of squares
- Our perspective: agentic analytics for the within-subjects workflow
- Try it on your own repeated measures data
- FAQ
- Sources
What repeated measures ANOVA does
A repeated measures design arises when each experimental unit has several observations of the dependent variable, collected at several time points or under several conditions. In an independent-groups ANOVA, different people sit in each group, so differences between groups are tangled up with differences between people. In a repeated measures ANOVA, the same participants are exposed to every level of the factor, which is why the design is also called within-subjects.
The statistical payoff is that the model separates subject-specific variation from the error term. That is why it is more sensitive than classical ANOVA for the same data: the denominator of the F ratio shrinks, because stable differences between people (some patients simply run higher on every visit) no longer count as noise.
The cost is non-independence. Two measurements from the same person are correlated, and the standard ANOVA assumption of independent errors no longer holds. Most of what follows is about handling that correlation honestly.
A concrete example
Suppose a rehabilitation study measures grip strength in 24 patients at baseline, 6 weeks and 12 weeks. The factor is time, with three levels, and each patient appears at all three. A one-way repeated measures ANOVA asks whether mean grip strength differs across the three occasions. A one-way ANOVA on the same 72 numbers would treat them as 72 independent people, overstate the error variance, and lose power.
When to use it: one-way, two-way, and mixed designs
Repeated measures ANOVA is appropriate for comparing means across three or more conditions or time points in the same group. The design determines which version you need.
| Design | Within-subjects factors | Between-subjects factors | Typical question |
|---|---|---|---|
| One-way repeated measures | 1 (time or condition) | 0 | Does the mean change across visits? |
| Two-way repeated measures | 2 (e.g., time and treatment dose) | 0 | Is there a time by dose interaction? |
| Mixed ANOVA | 1 or more | 1 or more (e.g., group) | Do the groups change differently over time? |
When a study has both between-subjects and within-subjects factors, a mixed-measures ANOVA is the appropriate analysis. The classic randomized trial with a treatment arm and a control arm, each measured at several visits, is a mixed design, and the effect you care about is usually the group by time interaction rather than either main effect.
Why not run several t-tests?
It is tempting to compare time 1 with time 2, time 2 with time 3, and time 1 with time 3 using paired or unpaired t-tests. This approach is not appropriate: it inflates the familywise error rate, and unpaired tests ignore the pairing entirely. Run the omnibus test first, then follow up with corrected pairwise comparisons. Our guide to multiple testing correction explains Bonferroni, Holm and false discovery rate approaches for those follow-ups.
Design issues that sit outside the model
Within-subjects designs reduce the influence of individual participant variables compared with independent-groups designs, but they introduce order, practice and fatigue effects. Counterbalancing the order of conditions is the standard control. ANOVA cannot fix an uncontrolled order effect after the fact, so settle this at the design stage.
Assumptions of repeated measures ANOVA
The assumptions listed in the clinical guidance are approximate normality, no extreme outliers, a categorical independent variable with three or more levels, and sphericity. Here is how to approach each.
- Independence between subjects. Participants must be independent of one another, even though their own repeated observations are not. Clustered data, such as patients nested in hospitals, needs another level of modeling.
- Normality. The assumption applies to the outcome within each condition (or to the residuals), not to the pooled data. Use a Q-Q plot and consider sample size: with small samples, formal tests have little power and plots are more informative.
- No extreme outliers. Inspect boxplots or standardized residuals per time point. A single data-entry error can dominate a small within-subjects design.
- Sphericity. The variances of the differences between all pairs of conditions should be equal. For three time points, that means Var(T1 minus T2), Var(T1 minus T3) and Var(T2 minus T3) should be roughly the same.
Sphericity, in practice
Sphericity is the assumption people most often forget and reviewers most often ask about. It is usually violated when conditions are measured over time, because adjacent time points tend to correlate more strongly than distant ones. Mauchly’s test assesses it, and Huynh-Feldt or Greenhouse-Geisser corrections address violations. Both corrections shrink the degrees of freedom by a factor epsilon, which makes the test more conservative.
A workable rule: report Mauchly’s test, and if it is significant (or epsilon is clearly below 1), report the Greenhouse-Geisser corrected F. Greenhouse-Geisser is the more conservative option; many analysts switch to Huynh-Feldt when epsilon is above about 0.75. Mauchly’s test has its own weaknesses, being underpowered in small samples and oversensitive in large ones, so looking at epsilon is more informative than reading the p-value alone.
When the assumptions fail
When normality is invalid, consider a data transformation or a nonparametric alternative such as the Friedman test. For serious violations of sphericity with more than a few time points, a multivariate approach or a mixed-effects model with an explicit covariance structure is cleaner than patching ANOVA with corrections.
Running and reading the analysis
The workflow is the same whether you use R, Python, SPSS, Stata, SAS or another tool.
- Reshape to long format. One row per subject per condition, with columns for subject ID, condition and outcome. Most packages require this.
- Plot first. Draw individual trajectories (spaghetti plots) with the group mean overlaid. Patterns such as ceiling effects or one participant moving against the group show up immediately. See our data visualization best practices for how to make these figures readable.
- Fit the model with the subject as the error stratum (in R, a formula such as
outcome ~ condition + Error(subject/condition), or theafexandrstatixwrappers that also report sphericity). - Check sphericity and choose corrected or uncorrected degrees of freedom.
- Report the omnibus F, corrected degrees of freedom, p value and an effect size.
- Follow up with pairwise comparisons under a multiplicity correction, or with planned contrasts if you specified them in advance.
Effect sizes
Partial eta squared is the common choice. It is the variance explained by the condition divided by the total variance excluding subject-specific effects. Report it with a confidence interval when your software allows it, and note that generalized eta squared is better when you need to compare across within- and between-subjects designs. For help translating the numbers into substantive terms, see our guide to effect size interpretation. If you are planning a study, run a power analysis before collecting data; our roundup of power analysis software covers options for within-subjects designs.
Reporting
Reviewers want accuracy, completeness and transparency. Maurissen and Vidmar’s survey of repeated-measure analyses stresses the ACT principles of accuracy, completeness and transparency so readers can judge validity. In practice, give the number of participants analyzed, the sphericity test and correction used, the F statistic with degrees of freedom, the effect size, the follow-up method, and how missing data were handled.
Missing data and when to move to a mixed model
This is the most common reason a repeated measures ANOVA turns out to be the wrong tool. Repeated measures ANOVA excludes any experimental unit with a missing measurement, while mixed-effects models can include units with missing or unequal numbers of measurements. If 30 of 100 participants miss one visit, listwise deletion removes 30 people from the analysis, which costs power and can bias results if dropout is related to the outcome.
Mixed-effects models are also recommended for their flexibility with covariance structures and relative insensitivity to missing data. Choose a mixed model when:
- participants have missing visits or unequal numbers of observations;
- measurement times differ between participants;
- you have a continuous time variable or a time-varying covariate;
- sphericity is clearly violated and you want to model the covariance directly.
Repeated measures ANOVA remains a good choice for small, balanced, fully observed experiments, such as a psychology study where everyone completes every condition. Its simplicity is an advantage there, and the output is familiar to reviewers.
ANOVA vs. ANCOVA
ANCOVA adds a continuous covariate to an ANOVA model. The usual use is a randomized comparison with a baseline measurement: ANCOVA compares final values across groups while accounting for baseline values, whereas ANOVA does not.
Pretest-posttest data: ANCOVA or repeated measures ANOVA?
With two time points and two groups, you can analyze the data as a mixed ANOVA (group by time) or as an ANCOVA on the posttest with the pretest as a covariate. Bishop and Hulme note that ANCOVA with a pretest covariate is often preferred over repeated measures ANOVA on change scores, because it can give higher power and better accounts for the correlation between pretest and posttest. In a randomized trial, the group by time interaction in the mixed ANOVA tests the same hypothesis as a change-score comparison, but with less precision when the baseline-outcome correlation is below 1.

Assumptions of ANCOVA
ANCOVA keeps the ANOVA assumptions (normality, homogeneity of variance, independent observations) and adds two more: a linear relationship between covariate and outcome within each group, and parallel regression lines across groups, known as homogeneity of regression slopes. The covariate should also be independent of the treatment, which is why baseline measures in randomized trials are ideal covariates, whereas variables affected by treatment are not.
To check slopes, fit a model with the group by covariate interaction. If the interaction is substantial, the treatment effect depends on the covariate, and a single adjusted mean difference is misleading.
A worked ANCOVA example
Imagine a trial of two exercise programs with 40 patients per arm. The outcome is systolic blood pressure at 12 weeks, and the covariate is baseline systolic blood pressure. A one-way ANOVA on the 12-week values compares raw means; if randomization left arm B slightly higher at baseline, that gap leaks into the result. ANCOVA instead estimates the arm difference at the same baseline value, reports adjusted means, and usually yields a narrower confidence interval because baseline explains a large share of the outcome variance. You would report the adjusted mean difference, its 95% confidence interval, and the check on slope homogeneity.
ANCOVA vs. MANOVA vs. regression
| Method | Outcomes | Predictors | Use it when |
|---|---|---|---|
| ANOVA | One | Categorical | Comparing group means |
| ANCOVA | One | Categorical plus continuous covariate | Adjusting group means for a baseline or nuisance variable |
| MANOVA | Two or more | Categorical | Testing group differences on several related outcomes jointly |
| Linear regression | One | Any mix | General framework |
ANCOVA is not a separate beast from regression: it is a linear regression with a categorical predictor and a continuous covariate, just presented with ANOVA conventions. MANOVA addresses a different problem, which is several correlated dependent variables, and ANCOVA has a multivariate counterpart, MANCOVA, when you need both.
Type II vs. Type III sums of squares
With balanced data, Type I, II and III sums of squares agree. They diverge with unbalanced factorial designs, which are common once participants drop out. Type II sums of squares test each main effect after adjusting for the other main effects, but not for the interaction, and tend to be more powerful when no interaction exists. Type III tests each term after adjusting for all others, interactions included, and is the default in SPSS and SAS. In R, base anova() gives Type I, so many analysts use car::Anova() and state which type they chose. Whichever you pick, name it in the methods, and use sum-to-zero contrasts if you use Type III so the main effects are interpretable.
To compare software for these choices, our ANOVA test software roundup and the broader statistical software articles cover the options.
Our perspective: agentic analytics for the within-subjects workflow
Repeated measures analysis is a good case study of where one-shot answers fail researchers. The correct analysis depends on a chain of decisions: Is the design balanced? Is there missingness, and is it plausibly ignorable? Does sphericity hold? Should the pretest be a covariate? Which sums of squares? Which correction for follow-ups? A single chat reply that returns an F statistic skips every one of those decisions, and a reviewer will ask about all of them.

That is why we built PlotStudio AI as agentic analytics for researchers. Specialized agents plan the investigation, write and run real code, inspect intermediate results such as the sphericity check or residual plots, and synthesize the findings. With Plan Mode, you can review the proposed approach, including the method and assumptions, and change it before anything runs. Skills let a lab encode its own conventions, such as always reporting Greenhouse-Geisser corrections or specific effect size measures. The code, statistics and charts stay available as Analysis Pages and can be exported to notebooks and PDF reports, so a supervisor who cannot reproduce your numbers can inspect exactly how they were produced.
We see PlotStudio AI as an emerging layer in the modern research toolkit, alongside R, Python, RStudio, Stata, SPSS, SAS and Jupyter. It does not replace them. Those tools provide the statistical computing; PlotStudio AI adds an agentic layer that plans, executes, inspects, validates and documents a complete analysis. It supports Python and R workflows, and analyses can run locally, which matters when patient data cannot go to a cloud service.
— Aymen
Try it on your own repeated measures data
If you have a long-format dataset and a deadline, PlotStudio AI lets you state the objective, review the plan (including the sphericity check, the correction and the follow-up method), and keep the resulting code and output for your methods section. You can start with the free trial or compare the plans on the pricing page. The Bring Your Own Key plan is listed at $39.99 per month, or $399.90 per year on the academic page.

For survival outcomes or more complex longitudinal structures, see our overview of survival analysis software.
FAQ
What is the difference between repeated measures ANOVA and a mixed ANOVA?
Repeated measures ANOVA has only within-subjects factors, so everyone is measured under every condition. A mixed ANOVA adds at least one between-subjects factor, such as treatment group. In a mixed design, the interaction between group and time is usually the main result.
What do I do if Mauchly’s test is significant?
A significant result means the sphericity assumption is doubtful. Use the Greenhouse-Geisser or Huynh-Feldt corrected degrees of freedom, which make the F test more conservative. If you have many time points, consider a mixed-effects model with an explicit covariance structure instead.
Can repeated measures ANOVA handle missing data?
Not well. It removes any participant with a missing measurement, which reduces power and can bias results when dropout is related to the outcome. Mixed-effects models can use all available observations from each participant and are generally the better choice with missing visits.
Should I use ANCOVA or repeated measures ANOVA for pretest-posttest data?
In a randomized design, ANCOVA with the pretest as a covariate is often preferred because it usually has more power than analyzing change scores. Check the linearity of the covariate relationship and the homogeneity of regression slopes first. If your question is about the trajectory across several time points, use a mixed ANOVA or mixed model instead.
What is the non-parametric alternative?
The Friedman test is the usual nonparametric alternative for a one-way repeated measures design with non-normal data. For designs with several factors, a transformation or a mixed model with a suitable distribution is generally more flexible.
Sources
- Guidelines for repeated measures statistical analysis approaches (PMC)
- Introduction to Repeated-Measures ANOVA (LibreTexts)
- Statistical notes for clinical researchers: a one-way repeated measures ANOVA (PMC)
- Statistics: Analysing repeated measures data (Statstutor)
- Experimental Design (Simply Psychology)
- Repeated-measure analyses: Which one? (PubMed)
- When Alternative Analyses of the Same Data Come to Different Conclusions (Bishop and Hulme, 2024)
- Assumptions for ANCOVA (Real Statistics)
- ANOVA Type I vs II vs III Sums of Squares (MetricGate)