UpSkill Sprint Consulting logo UpSkill Sprint Consulting Start a 15-min lesson

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.

Statistics

1. Build From the One-Way ANOVA Example

In the previous lesson, we tested whether material type affected tensile strength.

The material averages looked close:

Material Average Strength
Material A 95.00
Material B 96.50
Material C 97.00
From the one-way view, Material Type did not look very important. But that analysis ignored temperature.

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

\[ df_A = a - 1 \] \[ df_B = b - 1 \] \[ df_{AB} = (a - 1)(b - 1) \] \[ df_E = ab(n - 1) \] \[ df_{\text{Total}} = N - 1 = abn - 1 \]
For this example, \(a = 3\), \(b = 2\), \(n = 2\), and \(N = 12\).

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.

Critical F
Right-tail p-value
Decision
Rule
Reject if F > Critical F

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
\[ F_A = \frac{4.33}{2.00} = 2.17 \] \[ F_B = \frac{8.33}{2.00} = 4.17 \] \[ F_{AB} = \frac{196.33}{2.00} = 98.17 \]
Material Type is not significant as an average main effect, but the Material × Temperature interaction is significant.

6. Interactive Interaction Plot

Toggle the material lines on and off. If the lines are not parallel, that is evidence of interaction.

Material A drops from low to high temperature. Material B stays stable. Material C rises from low to high temperature. The lines are not parallel, so there is a strong 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
In the main-effect view, the material means look close. This is why Factor A has p-value greater than 0.05.
Memory phrase: Averaging can hide the effect; interaction reveals the pattern.

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.

B1
B2
B3
A1
A2
A3
A4

Selected Combination

Click a cell to see the details.

\[ \text{Interaction Effect}_{ij} = \bar{x}_{ij} - \bar{x}_{i.} - \bar{x}_{.j} + \bar{x}_{..} \]
The highest cell mean is not always the cell that drives the interaction most. The interaction effect shows how far the cell is from what would be expected based on row and column means.

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

\[ \eta_p^2 = \frac{SS_{AB}}{SS_{AB} + SS_E} \]

For the two-way ANOVA example:

\[ \eta_p^2 = \frac{392.67}{392.67 + 12.00} = 0.970 \]
This means the interaction explains a very large share of the explainable variation in this 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?

← Back to the Statistics lessons