Worked factorial-analysis example

In a two-way ANOVA, interpret the interaction first.

An interaction asks whether the effect of one factor changes across levels of the other. When it does, an overall main-effect average can hide the comparison your experiment was designed to answer.

60 observations3 × 2 factorial design10 replicates per cell9-minute read

The short answer

Ask whether the factor differences stay parallel.

A crossed two-way ANOVA models a continuous response using two categorical factors, their interaction and residual variation. The interaction null hypothesis says the systematic difference between supplement methods is the same at every dose—or, equivalently, the dose pattern is the same for both supplements.

Interaction-first rule: if the interaction is supported, describe cell means and pre-specified simple effects before presenting averages collapsed across the other factor. “Significant interaction” is not itself a biological mechanism.

The exact ToothGrowth design

R's built-in ToothGrowth dataset records odontoblast length in 60 guinea pigs. Each animal received one of three vitamin C doses—0.5, 1 or 2 mg/day—delivered as orange juice (OJ) or ascorbic acid (VC). That is a balanced 3 × 2 crossed design with ten independent observations in every cell.

Dose OJ mean (n = 10) VC mean (n = 10) OJ − VC
0.5 mg13.237.985.25
1 mg22.7016.775.93
2 mg26.0626.14−0.08
ToothGrowth means by dose and supplement Orange juice has higher mean tooth length at 0.5 and 1 milligram, but the two supplement means converge at 2 milligrams, creating an interaction. 010 2030 0.51 2 Dose (mg/day) Odontoblast length OJ VC means converge at 2 mg
Cell means from all 60 observations. The nonparallel profiles show why the supplement average must not be interpreted without dose.

The exact ANOVA result

SourcedfFPPartial η²
Supplement × dose2, 544.1070.021860.132
Dose2, 5492.0004.05×10⁻¹⁸0.773
Supplement1, 5415.5720.0002310.224

The interaction is the first result to interpret: F(2, 54) = 4.107, P = 0.02186. The mean OJ–VC difference is about 5.25 units at 0.5 mg and 5.93 units at 1 mg, then nearly disappears at 2 mg (−0.08). The overall supplement average of 3.70 units blends those different dose-specific comparisons.

What to examine after the interaction

  1. Plot cell means and raw observations. A line plot makes nonparallel profiles visible, but the raw values show overlap, spread and unusual observations.
  2. Name the simple effects in advance. In this example, the model-based OJ–VC tests give P = 0.00209 at 0.5 mg, P = 0.000590 at 1 mg and P = 0.961 at 2 mg.
  3. Control the intended family. Select the comparisons and multiplicity method from the scientific question; do not search every possible pair after seeing the interaction.
  4. Report effect sizes and intervals. A P value does not show how large or precise the interaction or cell differences are.

Design and assumption checks

  • Each row is an independent experimental unit. Technical replicates do not create ten independent animals.
  • The residual distribution and variance are plausible within the factorial model; inspect residuals rather than testing six cells in isolation.
  • Every dose occurs with every supplement. Missing or unequal cells require explicit choices about the estimand and sums of squares.
  • Dose is treated as a three-level categorical factor here. A continuous dose-response model answers a different question.
Historical-data caveat: ToothGrowth is a teaching benchmark from a historical animal experiment. It demonstrates factorial calculations; it is not evidence for a modern biological, clinical or animal-use conclusion.

A compact reporting template

“Odontoblast length was analyzed with an ordinary two-way ANOVA including supplement, dose and their interaction (n = 10 independent animals per cell). The supplement-by-dose interaction was F(2,54) = 4.107, P = 0.02186, partial η² = 0.132. Cell means and pre-specified simple comparisons were reported because the OJ–VC difference varied by dose.”

What Plotwright checks

Plotwright's executable published-example suite submits all 60 measurements to the production two-way ANOVA engine. The gate checks the supplement, dose and interaction F tests against the R benchmark with explicit tolerances. Separate tests cover sums of squares, cell means, simple effects, multiple comparisons, effect sizes and residual diagnostics.

Those checks validate defined numerical routes. They cannot establish independence, justify the factor model, select a comparison family or turn an interaction into a causal claim.

Sources and reproducibility

  1. R datasets documentation: ToothGrowth—the 60-observation dataset, factors, doses and original references.
  2. NIST/SEMATECH: two-way crossed ANOVA—the factorial model, variance partition, tests and assumptions.
  3. Kim (2014), interaction in two-way ANOVA—an interaction-first explanation for clinical researchers.
  4. Plotwright statistical validation—the published expected values, tolerance and evidence boundaries.

Keep the factorial design visible from cells to conclusion.

Plotwright opens the exact grouped table, two-way ANOVA, diagnostics, simple effects and editable graph in one local project.