# Two-way analysis of variance with measurement repetition

*Load ANOVA data set*

## 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.

Two-way analysis of variance with measurement repetition tests whether there is a difference between more than two samples divided between two variables or factors.

In contrast to the two-factorial analysis of variance without measurement repetitions, one of the factors is thereby created by measurement repetitions. In other words, one factor is a dependent sample.

## Sample with measurement repetition

What is the difference to the "normal" one-factor analysis of variance with repeated measures? Or what is the difference between one-factorial and two-factorial?

Single factorial 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 is interviewed 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 repeated measures analysis of variance.

Using two-way analysis of variance with repeated measures, you can now answer three things:

- Does the first factor with measurement repetition have an effect on the dependent variable?
- Does the second factor have an effect on the dependent variable?
- Is there an interaction between factor 1 and factor 2?

## Hypotheses

As already indicated, you can test three statements with the 2 factorial analysis of variance, so there are also 3 null hypotheses and therefore also 3 alternative hypotheses.

#### Null hypotheses:

- The mean values of the different measurement times do not differ (There are no significant differences between the "groups" of the first factor).
- The mean values of the different groups of the second factor do not differ.
- One factor has no influence on the effect of the other factor

## 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 prerequisites must be met:

- 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.
- The measurements of one factor should be dependent, e.g. the measurements should have arisen from repeated measurements of the same person.
- The measurements from the other factor should be independent, i.e. the measurement from one group should not be influenced by the measurement from another group.
- The variances in each group should be approximately equal. This can be checked with the Levene test.
- The data within the groups should be normally distributed.
- The variances of the differences between all combinations of the different groups should be equal (Sphericity). This assumption can be tested using Mauchly's test of sphericity.

## Calculate two-way analysis of variance with repeated measures

Calculate the example directly with DATAtab for free:

Load ANOVA data setLet's say this is our data we want to analyze. Each row is one person, the first factor reflects the three time points before therapy in the middle 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 datatab.net 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.

Most important in this table are the plotted three rows, with these three rows, you can test if the 3 null hypotheses we made before are kept or rejected. The first row tests you null hypothesis, whether blood pressure changes over time, so whether the therapies have an effect on blood pressure.

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 and if the calculated p-value is greater than 0.05, then the null hypothesis is retained.

Thus, we see that the p-value of before, middle and end is less than 0.05 and thus the before, middle and end times are significantly different in terms of blood pressure. The p-value in the second row is greater than 0.05, so the therapies have the same mean values 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 that were the case, however, we would have an interaction between the therapies and time. We test this with the last hypothesis.

In this case, there is no significant interaction between therapy and time.

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 276 pages
- 3rd revised edition (July 2023)
**Only 6.99 €**

*"Super simple written"*

*"It could not be simpler"*

*"So many helpful examples"*