A two-way ANOVA (“analysis of variance”) is used to determine whether or not there is a statistically significant difference between the means of three or more independent groups that have been split on two variables (sometimes called “factors”).
This tutorial explains the following:
- When to use a two-way ANOVA.
- The assumptions that should be met to perform a two-way ANOVA.
- An example of how to perform a two-way ANOVA.
When to Use a Two-Way ANOVA
You should use a two-way ANOVA when you’d like to know how two factors affect a response variable and whether or not there is an interaction effect between the two factors on the response variable.
For example, suppose a botanist wants to explore how sunlight exposure and watering frequency affect plant growth. She plants 40 seeds and lets them grow for two months under different conditions for sunlight exposure and watering frequency. After two months, she records the height of each plant.
In this case, we have the following variables:
- Response variable: plant growth
- Factors: sunlight exposure, watering frequency
And we would like to answer the following questions:
- Does sunlight exposure affect plant growth?
- Does watering frequency affect plant growth?
- Is there an interaction effect between sunlight exposure and watering frequency? (e.g. the effect that sunlight exposure has on the plants is dependent on watering frequency)
We would use a two-way ANOVA for this analysis because we have two factors. If instead we wanted to know how only watering frequency affected plant growth, we would use a one-way ANOVA since we would only be working with one factor.
Two-Way ANOVA Assumptions
For the results of a two-way ANOVA to be valid, the following assumptions should be met:
1. Normality – The response variable is approximately normally distributed for each group.
2. Equal Variances – The variances for each group should be roughly equal.
3. Independence – The observations in each group are independent of each other and the observations within groups were obtained by a random sample.
Two-Way ANOVA: Example
A botanist wants to know whether or not plant growth is influenced by sunlight exposure and watering frequency. She plants 40 seeds and lets them grow for two months under different conditions for sunlight exposure and watering frequency. After two months, she records the height of each plant. The results are shown below:
In the table above, we see that there were five plants grown under each combination of conditions.
For example, there were five plants grown with daily watering and no sunlight and their heights after two months were 4.8 inches, 4.4 inches, 3.2 inches, 3.9 inches, and 4.4 inches:
She performs a two-way ANOVA in Excel and ends up with the following output:
The last table shows the result of the two-way ANOVA. We can observe the following:
- The p-value for the interaction between watering frequency and sunlight exposure was 0.310898. This is not statistically significant at alpha level 0.05.
- The p-value for watering frequency was 0.975975. This is not statistically significant at alpha level 0.05.
- The p-value for sunlight exposure was 3.9E-8 (0.000000039). This is statistically significant at alpha level 0.05.
These results indicate that sunlight exposure is the only factor that has a statistically significant effect on plant height.
And because there is no interaction effect, the effect of sunlight exposure is consistent across each level of watering frequency.
That is, whether a plant is watered daily or weekly has no impact on how sunlight exposure affects a plant.
The following articles explain how to perform a two-way ANOVA using different statistical software: