Statistics made easy
8th revised edition (March 2026) - many illustrative examples - only €8.99
Two-way Analysis of Variance (ANOVA) with repeated measures
Author: Dr. Hannah Volk-Jesussek
Updated:
What is a two-way ANOVA with repeated measures?
If we look at the most common types of the analysis of variance, we distinguish once between the one-way and the two-way analysis of variance and on the other side the analysis of variance without measurement repetition and with measurement repetition. Now we will look at the two-way analysis of variance with measurement repetition.
A two-way ANOVA with repeated measures tests the effects of two factors and their interaction on a metric dependent variable. At least one factor is measured repeatedly on the same subjects.
In contrast to the two-factorial analysis of variance without measurement repetitions, at least one factor is created by repeated measurements. If one factor is measured repeatedly and the other compares independent groups, the design is called a mixed ANOVA.
Sample with measurement repetition
What is the difference to the "normal" one-way analysis of variance with repeated measures? Or what is the difference between one-factorial and two-factorial?
A one-way ANOVA with repeated measures tests whether there are statistically significant differences between three or more dependent samples.
In a dependent sample, the measured values are linked. Thus, one and the same person is measured at several time points.
Example two-factorial ANOVA with repeated measures
For example, if you take a sample of people with high blood pressure and measure their blood pressure before, during and after treatment, this is a dependent sample. This is because the same person's blood pressure is measured at different times.
You may want to know if the treatment for high blood pressure has an effect on the blood pressure. So you want to know if blood pressure changes over time.
But what if you have different therapies and you want to see if there is a difference between them? You now have two factors, one for the therapy and one for the repeated measurements. Since you now have two factors and one of the factors is a dependent sample, you use a two-way mixed ANOVA. Time is the within-subjects factor, and therapy is the between-subjects factor.
Using two-way analysis of variance with repeated measures, you can now answer three things:
- Is the mean of the dependent variable different across the levels of the repeated factor?
- Is the mean of the dependent variable different across the second factor?
- Is there an interaction between factor 1 and factor 2?
Hypotheses
As already indicated, you can test three statements with the two-way analysis of variance, so there are also three null hypotheses and three corresponding alternative hypotheses.
Null hypotheses:
- The population means at the different measurement times are equal.
- The population means of the groups in the second factor are equal.
- There is no interaction between the two factors: the pattern across measurement times is the same in each group.
Assumptions of the two-way analysis of variance with repeated measures
In order for a two-way analysis of variance with measurement repetition to be calculated, the following assumptions must be met:
-
Level of measurement:The scale level of the dependent variable should be
metric. For example, salary or blood pressure. The scale level of the factors should
be categorical.
-
Repeated measurements: Observations within subjects are related, e.g. the
measurements should have arisen from repeated measurements of the same person.
-
Independence of observations:
Observations from different subjects must be independent, i.e. one subject's
measurements should not influence another subject's measurements.
- Homogeneity of variance:The variances of the groups in the between-subjects factor should be approximately equal at each measurement time. This can be checked with the Levene test. Note: Homogeneity of variance is an assumption only when the model contains a between-subjects factor.
- Normality:For every combination of factor levels (each "cell" of the design), the errors (residuals) should be normally distributed.
- Extreme outliers:There should be no extreme outliers within the cells.
- Sphericity:For a within-subjects factor with three or more levels, the variances of the differences between all pairs of its levels should be equal. This assumption also applies to interactions involving that factor. It can be tested using Mauchly's test of sphericity. If sphericity is violated, a correction such as Greenhouse-Geisser can be used.
Calculate two-way analysis of variance with repeated measures
Medical example dataLet's say this is our data we want to analyze. Each row is one person, the first factor reflects the three time points before, in the middle of, and at the end of therapy, and the second factor reflects the type of therapy.
To calculate a two-way analysis of variance with repeated measures online, simply visit numiqo.com and copy your own data into the table.
Then click on hypothesis testing. Under this tab you will find a lot of hypothesis tests and depending on which variable you click on, you will get an appropriate hypothesis test suggested.
When you copy your data into the table, a list of the inserted variables appear below it. If the correct scale level is not automatically detected, you can easily change it under Variables View.
For example, if we click on "Before", "Middle" and "End", an analysis of variance with repeated measures is automatically calculated. But we also want to include the therapy, so we just click on "Therapy".
Now we get a two-way analysis of variance with measurement repetition.
We can read the three null and the three alternative hypotheses. Then we get the descriptive statistics output and then the results of the analysis of variance are displayed. We will look at these in detail in a moment.
Interpret two-way analysis of variance with repeated measures.
The three highlighted rows test the three null hypotheses stated above. The first row tests whether mean blood pressure differs across the measurement times.
The second row tests whether there is a difference between the respective therapies with respect to blood pressure. And the last row checks if there is an interaction between the two factors.
You can read the p-value at the very back of each one. Let's say we set the significance level at 5%. If our calculated p-value is less than 0.05, then the respective null hypothesis is rejected. If the calculated p-value is greater than or equal to 0.05, the null hypothesis is not rejected.
Thus, we see that the p-value of before, middle and end is less than 0.05 and thus the mean blood pressure differs across the measurement times. This omnibus result does not by itself show which time points differ; pairwise comparisons are needed for that. The p-value in the second row is greater than 0.05, so there is insufficient evidence of a difference in mean blood pressure between the therapies when averaged over time.
It is important to note that the mean value over the three time points is considered here. It could also be that in one therapy the blood pressure increases and in the other therapy the blood pressure decreases, but on average over the time points the blood pressure is the same, then we would not get a significant difference here.
If the changes over time differed sufficiently between therapies, this would appear as an interaction between therapy and time. The last row tests this hypothesis.
In this case, there is no significant interaction between therapy and time.
If an interaction is significant, simple-effects comparisons can be used to examine changes over time within each therapy or therapy differences at each time point. Corrections for multiple comparisons should be applied.
If you don't know exactly how to interpret the results, you can also just click on Summary in Words.
Statistics made easy
- many illustrative examples
- ideal for exams and theses
- statistics made easy on 464 pages
- 8th revised edition (March 2026)
Only €8.99
Free sample
"Super simple written"
"It could not be simpler"
"So many helpful examples"