Two-Way ANOVA: Main Effects, Interaction, and Treatment Combinations
This lesson builds on the one-way ANOVA material-strength example. We keep Material Type as Factor A and add Temperature as Factor B. You will see how interaction can reveal a pattern that one-way ANOVA may hide.
1. Build From the One-Way ANOVA Example
In the previous lesson, we tested whether material type affected tensile strength.
- Factor A: Material Type
- Levels of A: Material A, Material B, Material C
- Response: Tensile Strength
The material averages looked close:
| Material | Average Strength |
|---|---|
| Material A | 95.00 |
| Material B | 96.50 |
| Material C | 97.00 |
2. One-Way to Two-Way Reveal Button
Click the button to reveal the second factor: Temperature.
3. What Two-Way ANOVA Tests
Two-way ANOVA tests three things:
| Effect | Question It Answers | F-Statistic |
|---|---|---|
| Factor A: Material | Does material type affect strength on average? | \(F_A = MS_A / MS_E\) |
| Factor B: Temperature | Does temperature affect strength on average? | \(F_B = MS_B / MS_E\) |
| A × B Interaction | Does the effect of material depend on temperature? | \(F_{AB} = MS_{AB} / MS_E\) |
Degrees of Freedom
4. Interactive F-Distribution Graph
Use this graph to test any of the three two-way ANOVA F-statistics. The default values show the interaction test.
5. Two-Way ANOVA Table for This Example
| Source | SS | df | MS | F | p-value |
|---|---|---|---|---|---|
| Material Type, A | 8.67 | 2 | 4.33 | 2.17 | 0.196 |
| Temperature, B | 8.33 | 1 | 8.33 | 4.17 | 0.087 |
| A × B Interaction | 392.67 | 2 | 196.33 | 98.17 | < 0.001 |
| Error | 12.00 | 6 | 2.00 | — | — |
| Total | 421.67 | 11 | — | — | — |
6. Interactive Interaction Plot
Toggle the material lines on and off. If the lines are not parallel, that is evidence of interaction.
7. Main Effect vs Interaction Toggle
Use the buttons below to compare the averaged main-effect view against the interaction view.
Main Effect View: Material Averages
| Material | Average Strength |
|---|---|
| Material A | 95.00 |
| Material B | 96.50 |
| Material C | 97.00 |
Interaction View: Material by Temperature
| Material | Low Temperature | High Temperature | Pattern |
|---|---|---|---|
| Material A | 101 | 89 | Falls sharply |
| Material B | 96 | 97 | Almost flat |
| Material C | 89 | 105 | Rises sharply |
8. Treatment Combination Explorer
This section answers the question: If Factor A has 4 levels and Factor B has 3 levels, how do we know which combination has the most effect?
Click any cell in the 4 × 3 grid. The tool will show the cell mean, row mean, column mean, grand mean, and interaction effect.
Selected Combination
Click a cell to see the details.
9. How to Find the Strongest Combination
| Question | What to Check |
|---|---|
| Which combination gives the highest response? | Cell means |
| Which combinations are statistically different? | Tukey pairwise comparisons |
| Which combination drives the interaction most? | Interaction effects |
| How much is the practical difference? | Difference in means |
| How strong is the interaction overall? | Interaction p-value, \(SS_{AB}\), or partial eta-squared |
Effect Size for Interaction
For the two-way ANOVA example:
10. End-of-Lesson Quiz
1. If Factor A has p-value greater than 0.05 but the interaction has p-value less than 0.05, what should you do?
2. If Factor A has 4 levels and Factor B has 3 levels, how many treatment combinations are there?
3. What does a significant interaction mean?