What a two-way ANOVA tests
A two-way ANOVA looks at two factors at once and asks three questions: does factor A matter, does factor B matter, and does the effect of one depend on the other? That third question, the interaction, is often the most interesting. See two-way ANOVA explained.
Worked example
Plant growth under two levels of fertiliser and two of watering, with 4 plants in each cell. The cell means are 5.0 and 8.0 without fertiliser, and 6.5 and 12.75 with it. Fertiliser: F(1, 12) = 60.48, p < .001. Watering: F(1, 12) = 132.48, p < .001. Interaction: F(1, 12) = 16.35, p = .002. Fertiliser adds 1.5 under low watering and 4.75 under high watering, so its effect depends on the watering.
Assumptions
- Observations are independent. For repeated measurements on the same subjects you need a repeated-measures design.
- Residuals are roughly normal in each cell. Check with the normality test.
- Variances are similar across cells, especially when the cells differ in size.
Unequal cell sizes
With a balanced design, every type of sums of squares gives the same answer. With unequal cells they differ. This calculator uses Type III, the default in SPSS. Results match statsmodels’ anova_lm(typ=3) with sum-to-zero coding on 40 random designs, half of them unbalanced. For one factor, use the one-way ANOVA calculator.
Frequently asked questions
What is an interaction in a two-way ANOVA?
An interaction means the effect of one factor changes depending on the level of the other. On an interaction plot, it shows as lines that are not parallel.
How many observations do I need per cell?
You need at least one cell with more than one value for the test to run, but in practice aim for many more. Use a power calculation.
What if the interaction is significant?
Be careful with the main effects, as they average over a pattern that changes. Report the simple effects, meaning the effect of one factor at each level of the other.
Which sums of squares does this use?
Type III, the default in SPSS. With equal cell sizes, all types agree.