CalculatorsToolsGuides 日本語
BenchFig › Guides › Two-way ANOVA: how to run it and interpret the interaction
Statistics

Two-way ANOVA: how to run it and interpret the interaction

When an experiment crosses two factors, such as genotype and treatment, two-way ANOVA asks something a t test or one-way ANOVA cannot: whether the effect of one factor depends on the other (the interaction). Here is how to read the output, using the same numbers as the app’s sample.

Updated: BenchFig日本語

What two-way ANOVA tests

TestMeaningExample (genotype × treatment)
Main effect ADo means differ across levels of A (averaging over B)?Does tumor volume differ between WT and KO?
Main effect BDo means differ across levels of B (averaging over A)?Vehicle vs Drug
Interaction A × BDoes the effect of B depend on the level of A?Is the drug effect different in WT and KO?
Key points
  • If your question is “does the knockout change the response?”, the interaction is the answer
  • With a significant interaction, do not conclude from main effects alone (they are averages)
  • Each combination (cell) needs at least two values; for independent (unpaired) data
  • Same assumptions as one-way: independence, roughly normal cells, similar spread

Worked example

Wild-type (WT) and knockout (KO) mice received vehicle or drug, and tumor volume (mm³) was measured; six mice per cell (made-up data).

Mean ± SD (mm³), n = 6 per cell. Made-up example.
VehicleDrugDrug effect (Drug − Vehicle)
WT11.00 ± 1.0219.00 ± 1.588.00
KO13.05 ± 1.1425.90 ± 1.7912.85
051015202530VehicleDrugTumor volume (mm³)*****WTKO
Example data (the app’s “2 × 2 (fictional)” sample, n = 6 per cell). Bars = mean, error bars = SD, dots = animals. Asterisks: Šidák’s multiple comparisons of WT vs KO within each treatment (*P < 0.05, ****P < 0.0001). Drawn with BenchFig.

ANOVA table

Type III sums of squares (identical to Types I and II here because cell sizes are equal). F = MS ÷ residual MS.
SourceSSdfMSFPPartial η²
Genotype120.151120.1559.70< 0.00010.75
Treatment652.081652.08323.98< 0.00010.94
Genotype × treatment35.28135.2817.530.000450.47
Residual40.26202.01

Each F is the effect’s mean square divided by the residual mean square (2.01). Residual df = N − number of cells = 24 − 4 = 20.

Interpreting the interaction

The interaction is significant: F(1, 20) = 17.53, P = 0.00045. The last column of the table shows why: the drug effect is 8.00 mm³ in WT but 12.85 mm³ in KO, 4.85 mm³ larger. In a 2×2 design, the interaction tests exactly this “difference of differences”.

Is the interaction significant?
Yes: the effect of one factor depends on the other. Do not conclude from main effects; show simple effects / multiple comparisons within levels
No: effects are roughly additive. Main effects can be described directly (still show the group means)

On an interaction plot (cell means joined by lines), no interaction looks like parallel lines; an interaction makes them non-parallel. Here the KO − WT difference is 6.90 with drug versus 2.05 with vehicle.

Multiple comparisons

After a significant interaction, compare only the pairs that answer your question. Here WT and KO are compared within each treatment, with Šidák’s correction for the two comparisons (a correction suited to a few planned comparisons, also offered in GraphPad Prism’s two-way ANOVA).

Šidák: Padj = 1 − (1 − P)m, m = number of comparisons (2). The residual mean square from the ANOVA is used.
ComparisonDifference (KO − WT)95% CIAdjusted P
Vehicle: WT vs KO2.050.07 to 4.030.042
Drug: WT vs KO6.904.92 to 8.88< 0.0001

To compare every cell with every other (six pairs for four cells), use Tukey’s test. The more comparisons, the stricter each one, so limiting them to the ones you need improves power (the same logic as Tukey vs Dunnett).

Open this example on the two-way screenClick “2 × 2 (fictional)”. Choose comparisons within each treatment, within each genotype, or all cells (Tukey), and copy the methods sentence.
Open for free →

Two-way ANOVA in Excel

In Excel, use Data → Data Analysis (Analysis ToolPak) → “Anova: Two-Factor With Replication”. Put levels of A down the left and levels of B across the top, with the replicates stacked in the same number of rows for each cell (“Rows per sample” = n).

How to report it

Tumor volume was analyzed by two-way ANOVA with genotype and treatment as factors (model including the interaction). There was a significant genotype × treatment interaction (F(1, 20) = 17.53, P = 0.00045, partial η² = 0.47): the drug increased tumor volume more in KO mice. By Šidák’s multiple comparisons, KO exceeded WT by 2.05 mm³ with vehicle (P = 0.042) and by 6.90 mm³ with drug (P < 0.0001); n = 6 per group.

Main effects use the same format (genotype F(1, 20) = 59.70; treatment F(1, 20) = 323.98; both P < 0.0001). More in how to report statistics.

Common mistakes

Sources: Maxwell SE, Delaney HD, Kelley K (2018) Designing Experiments and Analyzing Data, 3rd ed., Routledge (two-way designs, interaction, Type III); Šidák Z (1967) J Am Stat Assoc 62:626–633; Microsoft Support (Excel Analysis ToolPak).

FAQ

What is the difference between one-way and two-way ANOVA?

One-way has a single factor (control and three doses); two-way has two crossed factors (genotype × treatment). You could compare the four 2×2 groups with one-way ANOVA, but then you cannot test directly whether the treatment effect differs between genotypes (the interaction).

If the interaction is not significant, do I just report main effects?

Broadly yes: without interaction the effects are roughly additive and the main effects describe them. But non-significant does not prove zero interaction, so still show the group means.

What if cell sizes are unequal?

The result depends on the type of sums of squares (I, II, III). GraphPad Prism and SPSS default to Type III, as does BenchFig. State which you used.

Can I use it for repeated measurements of the same animals?

No. Repeated measures need repeated-measures two-way ANOVA or a mixed model (BenchFig’s two-way analysis is for unpaired data).

Is there a nonparametric two-way ANOVA?

There is no single standard. Rank-based approaches (e.g. aligned rank transform) exist, but a transformation such as log often brings the data close enough to the ANOVA assumptions.

Run two-way ANOVA on the sample dataOn the two-way screen, click “2 × 2 (fictional)” to get the same ANOVA table, a grouped bar graph with asterisks, and a methods sentence.
Open for free →
Your own data, all the way to the final figure.Loading your files, saving, and journal-ready export (PDF, TIFF, PNG, SVG) are in BenchFig Pro for Windows, updated based on researchers’ requests: ¥3,980/year (2 PCs), with lab and perpetual licenses too.
About the app →

Related guides

Microsoft Excel is a trademark of Microsoft Corporation; GraphPad Prism is a trademark of GraphPad Software, LLC. Product and journal names are trademarks or registered trademarks of their respective owners.