← Back to Blog

Factorial design

Two-Way ANOVA and Interaction Effects

Statistics for clinical researchers and surgical trainees

In short

A two-way ANOVA does not return one answer, it returns three: two main effects and an interaction. When the interaction term is significant, the main effects stop describing any single group in your data; they describe an average across a comparison that does not hold uniformly. Clinical and surgical papers routinely lead with whichever main effect crossed P < .05 and push the interaction into a supplementary table, when the interaction is often the result that actually explains what happened.

Three tests, not one

Say you are comparing postoperative pain scores across two factors at once: surgical approach (open vs laparoscopic) and analgesia protocol (opioid-based vs multimodal). A two-way ANOVA on that design does not produce a single result. It produces three separate F-tests, each with its own degrees of freedom, F statistic, and P value: a main effect of approach, a main effect of protocol, and an approach × protocol interaction.

The main effect of approach asks whether pain scores differ between open and laparoscopic surgery, averaged across both analgesia protocols. The main effect of protocol asks the mirror question. The interaction asks something different in kind: whether the effect of approach depends on which protocol was used. That third question is not a refinement of the first two, it is a check on whether the first two are even the right thing to be asking.

Why a significant interaction changes what "which test" means

The standard advice is to read the interaction term first, before touching either main effect, because a significant interaction changes what those main effects mean. If approach and protocol do not interact, the main effect of approach is a fair summary: laparoscopic patients report lower pain than open, and that gap holds up regardless of which analgesia protocol they received. Interpreting the main effect directly is reasonable.

If they do interact, the picture is different. Picture an interaction plot with two lines, one per protocol, plotted across the two surgical approaches. If those lines cross (laparoscopic beats open under multimodal analgesia, but open beats laparoscopic under opioid-only), the main effect of approach can wash out to something small or non-significant even though approach matters enormously within each protocol. Averaging a large positive effect and a large negative effect produces a number near zero; the ANOVA's main-effect row will faithfully report that near-zero number, and a reader who stops there will conclude approach does not matter, when the correct conclusion is that approach matters a great deal, conditional on protocol.

At that point the tests that answer the clinical question are no longer the omnibus main effects. They are the simple effects: the effect of approach evaluated separately within each protocol, typically with a correction such as Bonferroni applied across the follow-up comparisons. This is the same statistical logic used to compare a treatment effect between two independent subgroups in a trial, formalised by Altman and Bland as a general method for testing whether two estimates genuinely differ rather than eyeballing two P values and declaring a difference exists.1 A two-way ANOVA interaction term is that same test, extended across more than two groups at once.

What clinical and surgical papers get wrong

Interaction (or subgroup) analyses show up constantly in clinical research, and recent reviews have found that "their proper assessment, interpretation and reporting remain challenging," despite interaction results sometimes being influential enough to change treatment protocols.2 Two failure patterns recur often enough to be worth naming directly.

The first is selective reporting: a significant main effect makes the abstract, while a significant interaction sitting in a supplementary table is never mentioned in the discussion. The reader walks away believing the main effect applies uniformly, when the study's own interaction term says it does not.

The second is treating a non-significant interaction as proof that no interaction exists. Interaction tests are typically far less powered than the main-effect tests they accompany. A trial with 80% power to detect the overall treatment effect has only about 29% power to detect an interaction of the same magnitude, and detecting a same-size interaction with equivalent power generally requires roughly four times the sample, increasing sharply as the interaction gets smaller relative to the main effect.3 Most clinical and surgical studies are not powered for their interaction term at all. "The interaction was not significant" is, in that setting, frequently a statement about sample size rather than about the underlying biology, and it should not be read as licence to report the main effect as though it holds everywhere.

Reporting both effects in AMA style

Report all three tests regardless of the significance pattern: F for each main effect and F for the interaction, each with degrees of freedom and an exact P value, plus an effect size. Partial eta squared (partial η2) is the standard effect size for factorial designs, playing the same role Cohen's d plays for a two-group comparison. A worked, illustrative example of a correctly formatted AMA result for an interaction term (not drawn from a real study, just showing the format): F(1,116) = 4.87, P = .03, partial η2 = 0.04.

If the interaction is significant, follow it immediately with the simple main effects, the effect of approach evaluated separately within each protocol, using a corrected alpha rather than reporting the omnibus main effect and moving on. If the interaction is not significant, say so explicitly and note whether the study had adequate power to detect one; silence on that point lets a reader assume more than the data support.

StatsPlease detects a two-factor design directly from your variable selection: set one Outcome and two categorical Group variables, and pressing Group Comparison fits the joint two-way model with the interaction term alongside the individual pairwise comparisons, computed from your data.

Try it yourself

Run a two-way ANOVA: in SPSS or StatsPlease

Use your own factorial dataset (two categorical factors, one continuous outcome) to walk through both tools.

In SPSS

  1. Analyze → General Linear Model → Univariate.
  2. Move your continuous outcome into Dependent Variable, and both categorical factors into Fixed Factor(s).
  3. Under Options, tick "Estimates of effect size" to get partial eta squared alongside each F test.
  4. Click OK. Read the two main-effect rows and the Factor1*Factor2 interaction row from the Tests of Between-Subjects Effects table.

In StatsPlease

  1. Upload your CSV, then open the Analysis tab.
  2. Set your continuous measurement as the Outcome, and both categorical factors as Group variables (2 to 12 categories each).
  3. Press the Group Comparison preset. With two Group variables and a scale Outcome selected, this automatically fits the joint two-way model with the interaction term, alongside the individual pairwise comparisons.
  4. Read both main effects and the interaction, each with F, degrees of freedom, exact P, and partial η2, on the Results tab.

Compare: both routes report the same three F-tests, computed with Type II sums of squares. SPSS requires you to build the model and read the interaction row yourself; StatsPlease surfaces it directly alongside the main effects rather than requiring a separate simple-effects follow-up analysis.

References

  1. Altman DG, Bland JM. Statistics Notes: Interaction revisited: the difference between two estimates. BMJ. 2003;326(7382):219. https://doi.org/10.1136/bmj.326.7382.219
  2. Brankovic M, Kardys I, Steyerberg EW, Lemeshow S, Markovic M, Rizopoulos D, Boersma E. Understanding of interaction (subgroup) analysis in clinical trials. Eur J Clin Invest. 2019;49(8):e13145. https://doi.org/10.1111/eci.13145
  3. Brookes ST, Whitely E, Egger M, Smith GD, Mulheran PA, Peters TJ. Subgroup analyses in randomized trials: risks of subgroup-specific analyses; power and sample size for the interaction test. J Clin Epidemiol. 2004;57(3):229–236. https://doi.org/10.1016/j.jclinepi.2003.08.009

Running a factorial design of your own? Upload your dataset, set your outcome and both Group variables, and press Group Comparison to get both main effects, the interaction, and the follow-up simple effects, all in AMA format, computed from your data.

Try StatsPlease free