Two-Way ANOVA
calculator.
Test two factors and their interaction on one outcome, from a balanced table.
- Material, F
- 7.91
- Temperature, F
- 28.97
- Interaction, F
- 3.56
The interaction is significant, so the effect of Material depends on the level of Temperature. Read the simple effects and the plot before quoting a main effect: a main effect here averages over different patterns.
Interaction plot of the cell means
Mean for each Material level across the levels of Temperature. The lines are far from parallel, as the interaction test says. The table of cell means gives the same figures.
How big is each effect?
- η² below 0.01
- negligible
- η² 0.01 to 0.06
- small
- η² 0.06 to 0.14
- medium
- η² 0.14 or more
- large
- Material, yours
- 0.138, medium
- Temperature, yours
- 0.504, large
- Interaction, yours
- 0.124, medium
Cohen's rough benchmarks, as quoted by Lakens (2013). Say whether you report η² or partial η²: the second leaves the other effects out of its total, so it runs larger.
ANOVA table
| Source | SS | df | MS | F | p | Critical F | η² | Partial η² |
|---|---|---|---|---|---|---|---|---|
| Materialdf 2 | 10,683.72MS 5,341.86η² 0.138Partial η² 0.369 | 2 | 5,341.86 | 7.911p 0.002Critical 3.35 | 0.002 | 3.354 | 0.138 | 0.369 |
| Temperaturedf 2 | 39,118.72MS 19,559.36η² 0.504Partial η² 0.682 | 2 | 19,559.36 | 28.968p < 0.0001Critical 3.35 | < 0.0001 | 3.354 | 0.504 | 0.682 |
| Material × Temperaturedf 4 | 9,613.78MS 2,403.44η² 0.124Partial η² 0.345 | 4 | 2,403.44 | 3.56p 0.0186Critical 2.73 | 0.0186 | 2.728 | 0.124 | 0.345 |
| Error (within cells)df 27 | 18,230.75MS 675.21 | 27 | 675.21 | |||||
| Totaldf 35 | 77,646.97 | 35 |
Cell means: Material down, Temperature across
| Level | Level 1 | Level 2 | Level 3 | All |
|---|---|---|---|---|
| Material 1All 83.17 | 134.75 | 57.25 | 57.5 | 83.17 |
| Material 2All 108.33 | 155.75 | 119.75 | 49.5 | 108.33 |
| Material 3All 125.08 | 144 | 145.75 | 85.5 | 125.08 |
| AllAll 105.53 | 144.83 | 107.58 | 64.17 | 105.53 |
Simple effects
Temperature, inside each level of Material
| Level | F | p | Differs |
|---|---|---|---|
| Material 1 | 11.822 | 0.0002Differs | Yes |
| Material 2 | 17.298 | < 0.0001Differs | Yes |
| Material 3 | 6.966 | 0.0036Differs | Yes |
Material, inside each level of Temperature
| Level | F | p | Differs |
|---|---|---|---|
| Temperature 1 | 0.656 | 0.5269No clear gap | No |
| Temperature 2 | 12.257 | 0.0002Differs | Yes |
| Temperature 3 | 2.117 | 0.14No clear gap | No |
Each F uses the error mean square of the whole table, 675.21, on 27 degrees of freedom. No adjustment is made for running several tests.
If you drop the interaction
Pooling folds the interaction into the error, and the error mean square moves from 675.21 to 898.21. Your interaction is significant, so this model does not fit these data.
Working
- 1Find the grand mean, then each row, column and cell meanGrand mean of 36 values: 105.528. The table of cell means shows the rest.
- 2Sum of squares for each factorMaterial: 12 × Σ(row mean − grand mean)² = 10,683.72Temperature: 12 × Σ(column mean − grand mean)² = 39,118.72
- 3The interaction is what the cell means leave overSS of cell means − 10,683.72 − 39,118.72 = 9,613.78
- 4Error is the spread of values around their own cell meanSS error = 18,230.75, on 27 degrees of freedom
- 5F for MaterialF =10,683.722675.21= 7.911, p = 0.002
- 6F for TemperatureF =39,118.722675.21= 28.968, p < 0.0001
- 7F for Material × TemperatureF =9,613.784675.21= 3.56, p = 0.0186
- 8Check: the parts add back to the totalsSS: 10,683.72 + 39,118.72 + 9,613.78 + 18,230.75 = 77,646.97, total 77,646.97df: 2 + 2 + 4 + 27 = 35, total 35
How it's worked out
You have one measured outcome and two factors, such as battery life by material and temperature. Three questions can be tested: does the first factor matter, does the second factor matter, and do they interact? An interaction means the effect of one factor depends on the level of the other.
With the same number of values in each cell, the total spread splits cleanly into four parts: one for each factor, one for the interaction, and one for error. That clean split is why this tool asks for a balanced table.
With levels of the first factor, of the second and values per cell, each factor's sum compares its level means with the grand mean . The error sum takes each value around its own cell mean . The interaction is what the cell means leave over after both factors.
Dividing a sum by its degrees of freedom gives a mean square. The degrees of freedom are , , and for error, where is the count of all values. Each F compares an effect with the error.
With one value per cell, nothing is left to measure error, so the interaction term has to stand in for it. The tool then tests both factors, assumes no interaction, and says so.
Simple effects test one factor inside each level of the other. For level of the first factor, the sum is taken around that level's own mean, and the F divides by the error mean square of the whole table, as UCLA's worked example does with the model's error degrees of freedom.
Worked examples
Which battery lasts longest, and does it depend on the heat?
This is Montgomery's battery example: three materials at three temperatures, with four batteries in each cell. Temperature has F = 28.97 (p below 0.0001), material has F = 7.91 (p = 0.002), and the interaction has F = 3.56 (p = 0.0186), all on 27 error degrees of freedom. UC Berkeley's analysis of the same data shows the same three F values.
The significant interaction means the materials do not keep one order at every temperature. Testing material at each temperature, the F values are 0.66 (p = 0.5269) at the lowest, 12.26 (p = 0.0002) at the middle and 2.12 (p = 0.14) at the highest. So the clear gap between materials shows up at the middle temperature. Those tests carry no adjustment for running three of them.
Crop yield with one plot per combination
Four varieties each get three fertilizers, with one plot per combination. The tool runs the additive model: variety has F = 22.29 (p = 0.0012) and fertilizer has F = 36.09 (p = 0.0005), on 6 degrees of freedom. These are real results only if the varieties respond to fertilizer in the same way, because the design has no way to test that. One extra plot per cell would change that.
Two teaching methods across class sizes
Here are made-up scores for two methods at three class sizes, three students per cell. Method has F = 60.5 and class size has F = 165.5, while the interaction has F = 0.5 (p = 0.6186). On the plot the two lines run almost side by side, so the gap between the methods is about the same at every class size, and you can quote that one gap.
Reading your result
Start with the interaction. If it is significant, the main effects average over patterns that differ, and McDonald advises against reading them as they stand. Describe one factor at each level of the other instead.
Look at the plot. If there are no interactions, the lines should be parallel. Crossing or spreading lines are a sign of one. Try the swap as well, since the same interaction can be clearer with the other factor along the axis.
Separate the two effect sizes. Eta squared is an effect's share of the total, and partial eta squared leaves the other effects out of the total. For temperature in the battery data, the two are 0.504 and 0.682. Lakens quotes 0.01, 0.06 and 0.14 as small, medium and large for eta squared, and warns that they fit poorly with covariates or repeated measures.
A dropped interaction changes the rest of the table. Pooling it into the error moves temperature's F from 28.97 to 21.78, on 31 degrees of freedom. That is only a fair model if the factors really do not interact, which this battery test says they do.
To compare levels of just one factor, use the one-way ANOVA calculator. It also gives pairwise comparisons.
Common mistakes
- Quoting a main effect past a significant interaction. An interaction means the simple effects differ, so the main effect is not general. A material that wins on average can lose at the temperature you care about.
- Treating one value per cell as a full test. The p-values appear, but they rest on assuming no interaction. GraphPad's guide says plainly that replication is much better.
- Entering an unbalanced table. This tool refuses one, as the clean split above needs equal cells. McDonald calls the unbalanced analysis much more complicated, with several competing methods, so use statistical software if cells differ.
- Using it for repeated measures. The F tests assume independent values, and both factors fixed. Measuring the same people at each level, or sampling levels at random, needs a different error term.
Questions people ask
Sources
- NIST/SEMATECH e-Handbook of Statistical Methods, section 7.4.3, Are the means equal?
- NIST/SEMATECH e-Handbook of Statistical Methods, section 7.4.3.7, The two-way ANOVA
- UC Berkeley Statistics 158, Main effects and interactions, spring 2026
- McDonald, J. H., Handbook of Biological Statistics, Two-way anova
- GraphPad Prism guide, When there is no replication
- Lakens, D. (2013), Calculating and reporting effect sizes, Frontiers in Psychology 4, 863
- OnlineStatBook, Tests supplementing ANOVA
- UCLA OARC, How can I do simple main effects using anovalator?