Two factors at once — and the famous picture that reads itself.
This is the finale — you've earned it. All year you've asked, "does one thing matter?" Now you can ask, "do two things matter — and do they matter together?" That last word is the whole game. The real world almost never lets one cause act alone: a drug works differently by age, a teaching method helps beginners but not experts, a stressor lands hard on one group and bounces off another. A two-way ANOVA is built to catch exactly that. By the end of today you'll look at a single line graph and say, out loud, what three different results are hiding inside it. One picture, three answers. Let's finish strong.
Back in Unit 13, one-way ANOVA let you compare three or more groups on one grouping variable — that variable is called a factor. A two-way ANOVA takes the natural next step: it studies two factors at the same time. The word "two-way" literally means "two factors." A 2×2 design (say it "two-by-two") is the simplest case — two factors, each with two levels. Two levels times two levels gives four groups, one for every combination.
Here's the payoff and the twist. Because you're crossing two factors, you don't get one answer — you get three, and each one gets its own F test:
| Result (its own F-test) | Plain English | The question it answers |
|---|---|---|
| Main effect of Factor A (the rows) | The overall effect of Factor A, averaging over Factor B | Does Factor A move scores overall? |
| Main effect of Factor B (the columns) | The overall effect of Factor B, averaging over Factor A | Does Factor B move scores overall? |
| A × B interaction | The two factors team up | Does the effect of one depend on the level of the other? |
Two main effects plus one interaction — three separate F ratios, each tested for significance on its own. That third one, the interaction, is new this unit, and it's the star of the show. Crucially, the interaction is not "the two main effects added together" — it's a genuinely separate question that the first two tests can't answer.
You could run two separate one-way ANOVAs — one per factor — but you'd never see the interaction. The interaction is the part that says "the effect of one factor changes depending on the other," and it only appears when both factors live in the same analysis. That's the whole reason to run a two-way ANOVA instead of two one-ways.
Everything in a two-way ANOVA is built from averages of a 2×2 grid. Two kinds of averages matter, and keeping them straight is most of the battle.
Here's the layout. The four inner numbers are cell means; the bold edge numbers are marginal means:
| B₁ (Col 1) | B₂ (Col 2) | Row marginal | |
|---|---|---|---|
| A₁ (Row 1) | cell A₁B₁ | cell A₁B₂ | mean of row A₁ |
| A₂ (Row 2) | cell A₂B₁ | cell A₂B₂ | mean of row A₂ |
| Col marginal | mean of col B₁ | mean of col B₂ | grand mean |
Read it like a map. The main effect of Factor A compares the two row marginals (far-right column). The main effect of Factor B compares the two column marginals (bottom row). The interaction lives inside the four cells — it asks whether the gap between cells changes from one row to the next. Same four numbers, three different questions.
Our class Vegan Study has 2 factors: country (USA, UK) and diet (omnivore, vegan), with 50 people in each of the 4 cells and self-compassion (1–5) as the score. Here are the 4 cell means, to 3 decimals so your hand math matches Sheets:
| Omnivore | Vegan | Marginal mean (row) | |
|---|---|---|---|
| USA | 3.174 | 3.446 | 3.31 |
| UK | 3.368 | 3.039 | 3.20 |
| Marginal mean (column) | 3.27 | 3.24 |
Averaging the 2 cell means gives the marginal mean here because every cell has the same number of people (50). In Sheets, =AVERAGEIF(B5:B204, "USA", D5:D204) gives the same 3.31 in 1 step. Round only at the end: rounding the cell means first can leave you 1 hundredth away from Sheets.
A main effect is the effect of one factor, averaging over the other. It's the marginal-means comparison, in words:
Main effects are the big picture — one factor at a time, the other one blurred out. Each gets its own F ratio (the same logic as Unit 13: between-groups variance over within-groups variance), and you decide each one with the familiar rule — if p < .05, reject the null for that effect; otherwise fail to reject it. "Fail to reject" — never "accept" — because absence of evidence isn't evidence of absence.
An interaction means the effect of one factor depends on the level of the other. That's the whole definition: it depends. The factors aren't acting alone — they're teaming up. In the table, you spot it by asking whether the gap between the two cells in one row is different from the gap in the other row. If Factor B helps a lot in Row 1 but barely at all in Row 2, B's effect depends on A — that's an interaction.
An interaction means the effect of one factor DEPENDS on the other. A study tip might help beginners a lot but do nothing for experts — the tip's effect depends on who you are. That dependence is the interaction.
And here's the subtle part that trips people up: an interaction can hide a main effect. If one group's scores rise while another's fall by about the same amount, the two changes cancel when you average them — so the main effect can look flat (non-significant) even though something dramatic is happening. The story isn't "nothing happened." The story is "it depends," and only the interaction term tells you that.
Here's the trick that makes all three results pop out of one picture. Put one factor on the x-axis and draw one line per group of the other factor. Each plotted point is a cell mean. Now read it in three quick looks:
The interaction is the only thing you read from whether the lines are parallel. Parallel → no interaction. Not parallel (crossing or fanning) → interaction. That one sentence is most of this unit. Slopes tell you about main effects; parallelness tells you about the interaction.
Here's the picture itself. On the left, the two lines cross — the effect of Factor B flips direction depending on Factor A. That non-parallelness is the interaction. On the right, for contrast, two perfectly parallel lines: there's a gap (a main effect) but the lines stay in step, so no interaction.
Here's the grand-finale calculator, embedded right here. Paste gender (B), threat_condition (S), and math_score (T) from the class Sheet and click Sort into cells & run, or hit "Load class data (gender × threat)" and then Run. You'll get all three F tests at once — the two main effects and, the one to watch, the interaction. The worked example below walks you through exactly what you'll see.
Unit 14. Two factors at once, plus the interaction. You get all 3 F tests with p and partial η², each cell's n, M, and SD, the marginal means, the source table, and the interaction plot. Demo: math scores by gender × threat condition (the stereotype-threat study). Watch for the interaction.
Fastest: paste 3 columns straight from the class Sheet
Columns side by side, like S and T? Select both letters, copy once, and paste in one box. The header row and blank rows are skipped. A 2×2 keeps 2 levels per factor. If a column has more, the calculator keeps the 2 largest groups and tells you what it set aside (for gender, Non-binary).
Or type or paste each cell's scores
Before the famous study, let's build the skill with clean numbers. Imagine a memory experiment crossing Factor A = study method (Massed vs. Spaced) with Factor B = test delay (Immediate vs. Delayed). The outcome is the number of words recalled. Here are the four cell means — predict each step before you reveal it.
| Immediate (B₁) | Delayed (B₂) | |
|---|---|---|
| Massed (A₁) | 30 | 20 |
| Spaced (A₂) | 30 | 40 |
Now the example to remember for the exam. In a classic line of research (Spencer, Steele, & Quinn, 1999), people take a hard math test. Half are quietly reminded beforehand of a negative stereotype about their group's math ability — that's the threat condition — and half are not — the control condition. The two factors are gender (Woman, Man) — our row factor, shown as the two lines — and threat condition (Control, Threat) — our column factor, on the x-axis; the outcome is the math score.
Here are the four cell means — the average math score for each combination — from the 180 women and men in our N = 200, with the marginal means added on the edges:
| Control | Threat | Row marginal | |
|---|---|---|---|
| Woman | 76.4 | 68.9 | 72.8 |
| Man | 79.2 | 80.6 | 79.9 |
| Col marginal | 77.6 | 74.3 | 76.0 |
Now picture the line graph — put condition on the x-axis (Control → Threat) and draw one line per gender:
The two lines are not parallel — they fan apart. That non-parallelness is the interaction. The effect of the threat reminder depends on gender: it hurts women's scores but leaves men's untouched. The marginals tell the "overall" story (men higher overall, 79.9 vs 72.8; a slight dip under threat overall, 77.6 vs 74.3) — but if you'd only looked at those marginals and ignored the cells, you'd badly miss the real headline.
Interaction: F(1, 176) = 11.13, p = .001 ✅ — the lines really do fan apart; threat's effect depends on gender, so we reject the null of no interaction. Main effect of gender (rows): F = 29.35, p < .001 — the Men's row marginal sits higher (79.9 vs 72.8). Main effect of condition (columns): F = 5.41, p = .021 — averaging the columns, scores dip a little under threat (77.6 → 74.3). The df are (1, 176): 180 women and men minus 4 cells. The interaction is the headline: this is THE graph for reading an interaction.
A two-way ANOVA reports three effect sizes — one per test. The standard choice is partial η² (partial eta-squared): each effect's SS divided by that SS plus the error SS. Read it just like Unit 13's η² — the share of variance an effect accounts for, with the other effects set aside:
partial η² = SS_effect ÷ (SS_effect + SS_within)
Why not Unit 13's η²? Plain η² divides by the total sum of squares: η² = SS_effect ÷ SS_total, the share of all the spread. In a one-way, the total holds only 2 pieces, the 1 effect and the within (the noise), so η² and partial η² are the same number. In a two-way, the total also holds the other 2 effects. If 1 factor has a big effect, it swells the total, and every other effect looks smaller, even though nothing about those effects changed. Partial η² leaves the other 2 effects out and compares each effect only with the noise, as if it were the only factor in the study. That is why published two-way ANOVAs report partial η² (written ηp² or ηp²), and why we use it for every two-way effect.
Here it is in numbers, with the Vegan Study's interaction. Only the country effect changes in the "what if" column; the interaction and the noise stay the same:
| Our data | What if country had a big effect? | |
|---|---|---|
| SS country | 0.57 | 40.00 |
| SS country × diet | 4.52 | 4.52 |
| SS within | 62.32 | 62.32 |
| SS total | 67.45 | 106.88 |
| η² = 4.52 ÷ SS total | .07 | .04 |
| partial η² = 4.52 ÷ (4.52 + 62.32) | .07 | .07 |
The interaction did not change, so its effect size should not change. Plain η² fell from .07 to .04 only because the country effect grew; partial η² stayed at .07. In our real data the main effects are tiny, so the 2 numbers agree.
For our stereotype-threat data: gender partial η² ≈ .14, condition ≈ .03, interaction ≈ .06. Common benchmarks: ~.01 small, ~.06 medium, ~.14 large. So the gender gap is a large effect, the overall threat dip is small, and the interaction — the headline — is medium: real and meaningful, but smaller than the marginal gender gap. The calculator above prints partial η² for all three effects.
A two-way ANOVA gets three APA sentences — one per test — and the interaction, when significant, leads the story. Same house rules as Units 10–13 (italicized letters, two decimals, no leading zero on p, effect sizes included):
"A 2 × 2 ANOVA revealed a significant gender × condition interaction, F(1, 176) = 11.13, p = .001, partial η² = .06: women scored lower under threat (M = 68.9, SD = 9.4) than in the control condition (M = 76.4, SD = 9.2), whereas men's scores did not differ (threat: M = 80.6, SD = 8.7; control: M = 79.2, SD = 8.2). There were also main effects of gender, F(1, 176) = 29.35, p < .001, partial η² = .14, and condition, F(1, 176) = 5.41, p = .021, partial η² = .03."
The anatomy: interaction first (it's the finding), immediately unpacked with the cell means that show what depends on what, then the main effects in a supporting sentence. When an interaction is significant, the main effects are footnotes to the "it depends" story — the write-up's order should say so.
You could stare at the four numbers and eventually work it out. But the line graph hands you all three results in a single glance. Train your eye on the three questions, in order, and they become automatic:
| What you look at | What it tells you |
|---|---|
| Do the lines slope, on average? | Main effect of the x-axis factor |
| Is one line higher than the other? | Main effect of the "lines" factor |
| Are the lines parallel, or not? | The interaction (parallel = none; crossing/fanning = yes) |
An interaction means the effect of one factor DEPENDS on the other. In the picture, that dependence shows up as lines that aren't parallel — women feel the threat, men don't, so the two lines refuse to stay in step.
A 2 × 2 design has only 8 possible patterns. Learn them and you can read any interaction graph cold. The classic textbook example: exercise intensity (light, heavy) on the x-axis, time of day (morning, evening) as the two lines, and hours of sleep that night as the outcome. Use the same 3 looks every time: is one line higher on average (main effect of the lines factor)? Do the lines slope on average (main effect of the x-axis factor)? Are the lines parallel (no interaction) or not (an interaction)?
| # | What the graph shows | Time of day | Intensity | Interaction |
|---|---|---|---|---|
| 1 | Lines flat, close together, parallel | no | no | no |
| 2 | One line higher; both flat and parallel | yes | no | no |
| 3 | Both lines rise together, nearly on top of each other | no | yes | no |
| 4 | One line higher, and both rise in step | yes | yes | no |
| 5 | Lines cross in an X; the averages tie | no | no | yes (crossover) |
| 6 | Morning higher; heavy exercise helps mornings and hurts evenings | yes | no | yes |
| 7 | Both rise, at different rates; the line averages tie | no | yes | yes |
| 8 | Morning higher, both rise, morning rises faster | yes | yes | yes |
Crossover or spreading (fan)? Both are interactions. Say "it depends" for a crossover and "only when" for a spreading interaction. In a crossover, the effect flips direction: our Vegan Study, where vegans score higher than omnivores in the USA (3.45 vs 3.17) and lower in the UK (3.04 vs 3.37). In a spreading interaction (also called a fan), the lines start together and spread apart: the effect is big at one level and small or zero at the other, like stereotype threat (women drop, men stay flat). The same reading works for bigger designs: a 2 × 3 has 6 cells, and an interaction shows up wherever the lines stop running in step.
Reading the two-way output. Software gives 3 F-tests, and you decide each one on its own. For the Vegan Study (50 per cell, N = 200): country F(1, 196) = 1.80, p = .182; diet F(1, 196) = 0.13, p = .719; country × diet F(1, 196) = 14.20, p < .001. Only the interaction is significant, which is what a crossover looks like. When you report it, say the interaction first, unpack it with the 4 cell means, and then give the main effects.
The graph shows the sample; the F-test says whether to trust it. Lines that are not quite parallel can still be noise. In the class data, gender × commuter on words recalled gives lines that cross, yet the interaction is F(1, 176) = 3.36, p = .068: fail to reject.
ANOVA splits the total spread into slices. One-way: SS total = SS between + SS within (Unit 13's diets: 292.85 = 72.13 + 220.72). Two-way: SS total = SS A + SS B + SS A × B + SS within. Each slice becomes a row of the source table: MS = SS ÷ df, and F = MS effect ÷ MS within.
| Source | SS | df | MS | F |
|---|---|---|---|---|
| Country | 0.57 | 1 | 0.57 | 1.80 |
| Diet | 0.04 | 1 | 0.04 | 0.13 |
| Country × diet | 4.52 | 1 | 4.52 | 14.20 |
| Within | 62.32 | 196 | 0.32 | — |
| Total | 67.45 | 199 | — | — |
df within = N − the number of cells (200 − 4 = 196); df total = N − 1. Partial η² for each effect = SS effect ÷ (SS effect + SS within): country .01, diet .00, country × diet .07.
Exam 4 has one source-table question. You get a few SS values, the design, and the critical Fs; you fill in the rest. Call the factors A and B. Five rules do all of it:
| Cell | Rule |
|---|---|
| SS A × B | SS total − SS A − SS B − SS within |
| df | A: k − 1 · B: k − 1 (k = the groups in that factor) · A × B: df A × df B · within: N − the number of cells · total: N − 1 |
| MS | SS ÷ df, on each row except total |
| F | MS effect ÷ MS within, for A, B, and A × B |
| Decision | F bigger than F crit → reject H₀ for that effect |
Check: the dfs for A, B, A × B, and within add to df total, and the SS rows add to SS total.
Exercise (light, moderate, heavy) × time of day (4 levels), 10 per cell, N = 120. Given: SS exercise = 46, SS time = 23, SS within = 360, SS total = 481.
| Source | SS | df | MS | F | F crit | Decision |
|---|---|---|---|---|---|---|
| Exercise (A) | 46 | 2 | 23.00 | 6.90 | 3.08 | reject |
| Time of day (B) | 23 | 3 | 7.67 | 2.30 | 2.69 | retain |
| A × B | 52 | 6 | 8.67 | 2.60 | 2.18 | reject |
| Within | 360 | 108 | 3.33 | — | ||
| Total | 481 | 119 | — | — |
SS A × B = 481 − 46 − 23 − 360 = 52. df within = 120 − 12 = 108; 2 + 3 + 6 + 108 = 119 ✔. Exercise and the interaction are significant; time of day is not. Report the interaction first: the effect of exercise on sleep depends on the time of day.
Music (silence, lyrics) × task (reading, math, memory), 15 per cell, N = 90. Given: SS music = 18, SS task = 40, SS within = 336, SS total = 416. F crit(1, 84) = 3.95 · F crit(2, 84) = 3.11.
| Source | SS | df | MS | F | F crit | Decision |
|---|---|---|---|---|---|---|
| Music (A) | 18 | 3.95 | ||||
| Task (B) | 40 | 3.11 | ||||
| A × B | 3.11 | |||||
| Within | 336 | — | ||||
| Total | 416 | — | — |
| Source | SS | df | MS | F | F crit | Decision |
|---|---|---|---|---|---|---|
| Music (A) | 18 | 1 | 18.00 | 4.50 | 3.95 | reject |
| Task (B) | 40 | 2 | 20.00 | 5.00 | 3.11 | reject |
| A × B | 22 | 2 | 11.00 | 2.75 | 3.11 | retain |
| Within | 336 | 84 | 4.00 | — | ||
| Total | 416 | 89 | — | — |
The same 3 as the one-way ANOVA: independent groups (different people in each cell), scores roughly normal in each cell (or 30 or more per cell), and similar spreads (SDs) in every cell. The Vegan Study passes all 3: 200 different people, 50 per cell, SDs from .52 to .59. Equal cell sizes help, because ANOVA then holds up well when a cell is a little off.
Sheets has no one-click two-way ANOVA, so we do the part that matters: the four cell means and the interaction graph. Use =AVERAGEIFS, which says "average the score column, but only the rows where gender matches and condition matches":
=AVERAGEIFS(score, gender, "Woman", cond, "Control") → 76.4
=AVERAGEIFS(score, gender, "Woman", cond, "Threat") → 68.9
=AVERAGEIFS(score, gender, "Man", cond, "Control") → 79.2
=AVERAGEIFS(score, gender, "Man", cond, "Threat") → 80.6
For the marginal means, drop one condition and average by gender alone (and vice versa):
=AVERAGEIF(gender, "Woman", score) → 72.8 (Woman row marginal)
=AVERAGEIF(cond, "Threat", score) → 74.8 (all 200 students; the 180 women and men alone give 74.3)
Lay the four cell means in a little 2×2 table, then Insert ▸ Chart ▸ Line chart with condition on the x-axis and one line per gender. That picture is your interaction graph — you'll watch the Women's line dive while the Men's line holds flat. Read the two main effects and the interaction right off it. The three F-values come from the provided template (or this page's calculator above).
Parallel = no interaction. Don't overthink it — the interaction lives in the parallelness of the lines, nothing else. An interaction can hide a main effect, and that's fine — if two opposite slopes cancel, the overall average looks flat even though "it depends" is the real story. Lines crossing OR fanning apart both count as an interaction. Decide each of the three tests with p ≤ .05, and say "fail to reject" — never "accept" — when a test comes up non-significant. And the headline of an interaction is always "it depends," never a flat one-size-fits-all claim.
That's the course. You started by squeezing 200 numbers into one average. You're finishing by reading two factors and their teamwork off a single line. The whole point of a two-way ANOVA is that one skill — spotting the interaction — so keep practicing reading those graphs until it's automatic. Well done.
Still hungry? There's one tool this course never needed but published research uses constantly: the test for categories and counts. Bonus Unit 15 — Chi-Square Tests is short, won't appear on Exam 4, and rounds out your toolkit.
A line graph appears; you call the main effect of the ROW variable (the lines), the COLUMN variable (the x-axis), and the interaction. It cycles through all 8 possible patterns — and "Show all 8 patterns" lays out the entire cheat-sheet at once.
Ten quick true/false items with instant explanations. The finale — real practice, never graded.