Two-way ANOVA foundations
Two Questions Become Three: Main Effects and the “Does It Depend?” Interaction
A one-way ANOVA asks about one grouping variable. A two-way ANOVA studies two grouping variables at the same time—and adds a new question: does the pattern for one factor change across the other factor?
By the end, you will be able to:
- Distinguish two main effects from an interaction.
- Calculate and interpret cell and marginal means.
- Explain how an interaction can qualify an overall main-effect pattern.
- Write accurate, bounded interpretations of common two-way ANOVA results.
Start with the design
One outcome, two ways of grouping people
Two-way ANOVA is used when one numerical outcome is compared across groups created by two categorical variables. “Two-way” refers to the two factors—not to two outcomes.
One grouping variable
Question: Do math scores differ across teaching methods?
Factor: Teaching method
Outcome: Math score
Two grouping variables
Question 1: Do scores differ by teaching method?
Question 2: Do scores differ by grade level?
Question 3: Does the teaching-method pattern depend on grade level?
Practice 1: One-way or two-way?
Choose the analysis that matches each research question.
Practice 2: Name each part of the design
For the study of teaching method, grade level, and math scores, classify each item.
The three effect questions
Two average questions and one “does it depend?” question
Each effect answers a different question. The main effects use marginal means. The interaction uses the changing differences among the cell means.
When grade levels are combined, do Lecture and Flipped classes have different average scores?
When teaching methods are combined, do 10th- and 11th-grade students have different average scores?
Does the Lecture-versus-Flipped difference change across grade levels?
Interaction = “Does the answer depend on the other factor?”
Practice 3: Match each question to the effect
Choose the effect that answers each question.
I do: make the thinking visible
Classroom example: calculate the averages before interpreting the pattern
The four cell means show what happened in each specific combination. Marginal means summarize the average pattern for each factor.
Across grade levels, Flipped is 2.5 points higher in the sample.
Across teaching methods, 11th grade is 2.5 points higher in the sample.
The method gap changes by 15 points across grade levels. The sign also reverses, which creates the crossover shape. This is a descriptive measure of the changing pattern—not a significance test.
Read the pattern in the correct order
Cell means as lines
The lines cross because the higher-scoring method changes across grade levels.
What can and cannot be concluded
Supported descriptively: The teaching-method pattern changes direction across grade levels in this sample.
Not yet supported inferentially: The interaction is statistically significant.
Why? The graph shows sample means. The F-test and p-value determine whether the population evidence supports the interaction.
Practice 4: Calculate the marginal means
Use the classroom cell means. Enter the four marginal means and choose the best descriptive interpretation.
See the shapes
Interactions do not have to cross
An interaction is any meaningful change in the size or direction of one factor’s difference across the other factor. Crossing, diverging, and converging lines are all nonparallel patterns.
The gap stays about the same.
The difference grows.
The difference shrinks.
The direction reverses.
First find the difference between Lecture and Flipped inside each grade. Then subtract one grade-specific difference from the other. A value near zero produces roughly parallel lines. A value farther from zero shows a larger descriptive change in the gap. The interaction F-test and p-value are still required to decide whether the population interaction is statistically supported.
For the classroom means: +10 − (−5) = 15 pointsPractice 5: Explore how the pattern changes
Adjust the four cell means. Watch the marginal means and how much the teaching-method gap changes across grades. Then choose the best description.
We do: another context
Healthcare example: the overall program means can hide a reversal
Recovery time is measured in days. Lower means faster recovery.
| Program | Men | Women | Program marginal mean |
|---|---|---|---|
| Program A | 8 days | 5 days | 6.5 days |
| Program B | 7 days | 6 days | 6.5 days |
| Gender marginal mean | 7.5 days | 5.5 days | — |
Practice 6: Interpret the healthcare pattern
Choose the best descriptive conclusion for each effect.
Practice 7: Interpret four result combinations
Use all three p-values. Choose the statement that accurately describes each set of results.
We do: connect means to the three tests
Read one complete Two-Way ANOVA before working independently
The cell means showed a possible crossover. Now suppose the software reports the following illustrative output for the classroom study.
Software usually reports a separate effect-size estimate for Factor A, Factor B, and the interaction. Partial eta squared estimates how much outcome variation is associated with one effect after separating that effect from the model's error variation. Interpret each value with its own effect. Do not add the partial eta-squared values together; they overlap in what they condition on and are not pieces of one simple 100% total.
| Effect | F | p | Partial η² | What the test asks |
|---|---|---|---|---|
| Teaching Method | F(1,116)=5.20 | .024 | .043 | Do Lecture and Flipped differ on average across grades? |
| Grade Level | F(1,116)=4.70 | .032 | .039 | Do 10th and 11th grade differ on average across methods? |
| Method × Grade | F(1,116)=8.10 | .005 | .066 | Does the method difference change across grades? |
Check all three p-values
Each p-value is below .05, so the output supports both main effects and the interaction.
Interpret the interaction first
The interaction is supported, so the changing cell pattern is more informative than either overall average alone.
Return to the cells
Flipped is 10 points higher in 10th grade, but 5 points lower in 11th grade. The direction reverses.
Qualify the main effects
Flipped and 11th grade have slightly higher marginal means, but those averages hide the crossover. Do not describe either main effect as a universal advantage.
Interpret each effect size separately
Partial η² is .043 for Method, .039 for Grade, and .066 for the interaction. Each value belongs to a different statistical question.
Identify the next comparison
A simple effect compares one factor inside one level of the other factor—for example, Lecture versus Flipped separately in 10th grade and separately in 11th grade.
Math scores showed significant main effects of teaching method, F(1,116)=5.20, p=.024, partial η²=.043, and grade level, F(1,116)=4.70, p=.032, partial η²=.039. These average effects were qualified by a significant Teaching Method × Grade Level interaction, F(1,116)=8.10, p=.005, partial η²=.066. The cell means showed that Flipped instruction was 10 points higher than Lecture in 10th grade, whereas Lecture was 5 points higher than Flipped in 11th grade. Therefore, the teaching-method pattern depended on grade level, and simple-effect comparisons would be needed to evaluate the method difference within each grade. The output supports an association among method, grade, and scores; causal wording depends on how students were assigned to instructional conditions.
Result language
Say exactly what each test supports
The three hypotheses are separate. A significant interaction does not erase the main effects, but it may make the marginal averages less useful by themselves.
Practice 8: Integrated unfamiliar challenge
A company compared training-confidence scores by delivery format and employee experience. Use the table and inferential output to write a bounded interpretation.
| Delivery format | New employees | Experienced employees |
|---|---|---|
| Live Workshop | 82 | 88 |
| Self-Paced | 74 | 86 |
Confidence scores differed significantly by delivery format, F(1,116)=8.90, p=.004, partial η²=.071, with Live Workshop participants scoring higher on average than Self-Paced participants. Experienced employees also scored significantly higher than new employees, F(1,116)=20.50, p<.001, partial η²=.150. These main effects were qualified by a significant Format × Experience interaction, F(1,116)=4.70, p=.032, partial η²=.039. The Live-versus–Self-Paced gap was 8 points for new employees but only 2 points for experienced employees, indicating that the delivery-format difference was larger for new employees. The three partial eta-squared values describe the size of three different effects and should be interpreted separately rather than added together. Because employees selected their own training format, the results show an association and do not prove that the Live Workshop caused the higher confidence scores.