Learner Journey Labs logoLearner Journey Labs
0 of 8

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-way ANOVA

One grouping variable

Question: Do math scores differ across teaching methods?

Factor: Teaching method

Outcome: Math score

Two-way ANOVA

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?

How to read 2 × 2. The first 2 means Teaching Method has two levels: Lecture and Flipped. The second 2 means Grade Level has two levels: 10th and 11th. Multiplying 2 × 2 gives four cells. A 2 × 3 design would have two levels of one factor, three levels of the other factor, and six cells.
Why not run separate one-way ANOVAs? Separate analyses can test each factor in isolation, but they do not directly test whether the two factors combine to create a changing pattern. That changing pattern is the interaction.
FactorA categorical grouping variable, such as teaching method or grade level.
LevelOne category inside a factor. Lecture and Flipped are two levels of Teaching Method.
Dependent variableThe numerical outcome whose means are compared, such as math score or recovery time.
CellOne exact combination of factor levels, such as Flipped instruction for 10th-grade students.
Cell meanThe average outcome for one cell.
Marginal meanAn average for one factor after combining across the other factor.
Main effectAn average difference associated with one factor after averaging across the other factor.
InteractionA pattern in which the size or direction of one factor’s difference changes across the other factor.

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.

Teaching Method

When grade levels are combined, do Lecture and Flipped classes have different average scores?

Grade Level

When teaching methods are combined, do 10th- and 11th-grade students have different average scores?

Teaching Method × Grade Level

Does the Lecture-versus-Flipped difference change across grade levels?

Interaction = “Does the answer depend on the other factor?”

Important: A main effect is an average pattern. It does not promise that the same difference appears inside every level of the other factor. An interaction tells you whether that average is hiding a changing subgroup pattern.
Identify the factorsWhat are the two categorical ways participants are grouped?
Identify the outcomeWhat numerical score or measurement is compared?
Build the cellsList every combination of factor levels.
Ask three questionsMain effect A, main effect B, and interaction.
Translate the patternDescribe the overall averages and whether the cell differences stay stable or change.

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.

10th grade
11th grade
Lecture
70Lecture–10th cell mean
80Lecture–11th cell mean
Flipped
80Flipped–10th cell mean
75Flipped–11th cell mean
Teaching Method marginal meansLecture: (70 + 80) ÷ 2 = 75Flipped: (80 + 75) ÷ 2 = 77.5

Across grade levels, Flipped is 2.5 points higher in the sample.

Grade Level marginal means10th: (70 + 80) ÷ 2 = 7511th: (80 + 75) ÷ 2 = 77.5

Across teaching methods, 11th grade is 2.5 points higher in the sample.

How much does the method gap change? 10th-grade gap: 80 − 70 = +10 11th-grade gap: 75 − 80 = −5 Difference-in-differences: 10 − (−5) = 15

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.

Important boundary for marginal means. These simple averages work because this teaching example treats the four cells as equally weighted. When cells contain different numbers of participants, do not automatically average the cell means by hand. Use the estimated marginal means reported by the statistical software.

Read the pattern in the correct order

1. Describe the cell meansFlipped has the higher sample mean for 10th grade. Lecture has the higher sample mean for 11th grade.
2. Describe the marginal meansFlipped and 11th grade each have a small 2.5-point overall advantage when averaged across the other factor.
3. Notice what the averages hideThe overall 2.5-point teaching-method difference hides a +10 difference in one grade and a −5 difference in the other.
4. State the boundaryThe means suggest a crossover interaction pattern. Statistical significance still requires the interaction F-test and p-value.

Cell means as lines

10th11thLectureFlippedMath score

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.

Parallel: little interaction pattern

The gap stays about the same.

Diverging

The difference grows.

Converging

The difference shrinks.

Crossing

The direction reverses.

Graph rule: Nonparallel lines suggest an interaction pattern, but the graph alone does not prove statistical significance. Use the interaction F-test and p-value.
Difference-in-differences means “how much did the gap change?”

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 points

Practice 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.

70
80
80
75
10th11th
Teaching-method meansLecture 75.0; Flipped 77.5
Grade-level means10th 75.0; 11th 77.5
Change in the method gapDifference-in-differences15.0 points

We do: another context

Healthcare example: the overall program means can hide a reversal

Recovery time is measured in days. Lower means faster recovery.

ProgramMenWomenProgram marginal mean
Program A8 days5 days6.5 days
Program B7 days6 days6.5 days
Gender marginal mean7.5 days5.5 days
Program main-effect patternThe two program marginal means are both 6.5 days, so there is no descriptive overall program difference.
Gender main-effect patternWomen have a recovery-time mean two days shorter than men when programs are combined.
Interaction patternProgram B is faster for men, while Program A is faster for women. The better-performing program changes across gender.
BoundaryThese are descriptive means. Statistical conclusions require the three two-way ANOVA tests.

Practice 6: Interpret the healthcare pattern

Choose the best descriptive conclusion for each effect.

Descriptive evidenceCell means, marginal means, and line shapes show the sample pattern.
Inferential evidenceEach F-test and p-value determines whether the population evidence supports Main Effect A, Main Effect B, or the interaction.
Means and graphs are descriptiveThey show the pattern in the sample: cell differences, marginal means, and line shape.
F-tests and p-values are inferentialThey determine whether the evidence supports the corresponding population main effect or interaction.

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.

Partial eta squared (partial η²)

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.

EffectFpPartial η²What the test asks
Teaching MethodF(1,116)=5.20.024.043Do Lecture and Flipped differ on average across grades?
Grade LevelF(1,116)=4.70.032.039Do 10th and 11th grade differ on average across methods?
Method × GradeF(1,116)=8.10.005.066Does the method difference change across grades?
Step 1

Check all three p-values

Each p-value is below .05, so the output supports both main effects and the interaction.

Step 2

Interpret the interaction first

The interaction is supported, so the changing cell pattern is more informative than either overall average alone.

Step 3

Return to the cells

Flipped is 10 points higher in 10th grade, but 5 points lower in 11th grade. The direction reverses.

Step 4

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.

Step 5

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.

Step 6

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.

Complete model interpretation

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.

What stays separate: A significant interaction does not mathematically erase the two main effects. It changes how useful those marginal averages are by themselves. Begin with the interaction, then explain the cell pattern and any appropriate simple effects.

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.

Factor A onlyAverage scores differed across Factor A when averaging across Factor B. The interaction did not provide evidence that this difference changed across Factor B.
Factor B onlyAverage scores differed across Factor B when averaging across Factor A.
Both main effects, no interactionBoth factors showed average differences, and the evidence did not indicate that either pattern changed across the other factor.
Interaction supportedThe pattern for one factor differed across the levels of the other. Examine the cell means and appropriate follow-up comparisons.
No supported effectsThe analysis did not provide sufficient evidence of either main effect or an interaction.
Never write“Everyone performed the same,” “the interaction cancels the main effects,” or “crossing lines prove significance.”
Interaction first when it matters: When an interaction is supported, begin by explaining the changing cell pattern. Then interpret marginal main effects carefully because an average can hide opposite subgroup differences.
Partial η² reminder: Interpret .071 with Delivery Format, .150 with Experience, and .039 with the interaction. These are separate effect-size estimates. They should not be added together as though they divide one 100% total.

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 formatNew employeesExperienced employees
Live Workshop8288
Self-Paced7486
Inferential output: Delivery Format, F(1,116)=8.90, p=.004, partial η²=.071; Experience, F(1,116)=20.50, p<.001, partial η²=.150; Format × Experience, F(1,116)=4.70, p=.032, partial η²=.039. Employees selected their own format.
Model answer:

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.

Stop here: The next lesson begins detailed variable setup and design identification. This page focuses on the meaning of main effects, marginal means, cells, and interaction.