Two-Way ANOVA (factorial A × B)

Verified

ANOVA

Independently verified. Every statistic this test reports has been re-derived against an independent reference — never the library the pipeline itself calls — the rendered output was read back in a browser, and the result is locked with a committed regression suite.

Run this test straight away on a free built-in teaching dataset — no data of your own needed — or bring your own. Either opens the guided workspace: variable setup, assumption diagnostics, results with effect sizes and confidence intervals, figures, and APA-ready reporting.

Loading teaching datasets…

Or use your own dataset

Loading your datasets…

Tests the individual and combined effects of TWO categorical independent variables on a continuous DV.

Reports three F-tests: Factor A main effect, Factor B main effect, and the A×B interaction. The interaction tests whether Factor A's effect DEPENDS on the level of Factor B. Effect sizes per term as η²p / ω²p; engine auto-handles Type-III SS for unbalanced cells, Levene + Shapiro diagnostics, and routes to nonparametric ART or robust trimmed-means variants when assumptions fail.

Worked example

Do drug dose and sex jointly affect reaction time — and does dose work differently by sex?

80 participants crossed by Dose (low/high) × Sex (male/female); a two-way ANOVA on reaction time (ms), with the interaction as the headline.

Result

A significant Dose × Sex interaction, F(1, 76) = 14.53, p < .001, partial η² = .16, showed the dose effect was stronger in men than women.

How you'd report it (APA)

A two-way ANOVA revealed a significant Dose × Sex interaction, F(1, 76) = 14.53, p < .001, partial η² = .16.

Try it yourself: Load this ready-made sample and follow the run above.

When to use it

  • Factorial design (A × B fully crossed)
    A researcher studies the effect of diet (low-fat, Mediterranean, keto) and exercise (sedentary, active) on weight loss.
  • Independent 2-factor observational design
    Is exam performance related to both gender (male/female) and class year (freshman/sophomore/junior/senior)?

When NOT to — use instead

Hypotheses

Three null hypotheses: (1) H₀_A: no main effect of factor1 — μ_{A.} are all equal across levels of factor1; (2) H₀_B: no main effect of factor2 — μ_{.B} are all equal across levels of factor2; (3) H₀_AB: no interaction — the effect of factor1 on the DV is the same at every level of factor2.
Hₐ_A: at least one factor1 marginal mean differs; Hₐ_B: at least one factor2 marginal mean differs; Hₐ_AB: the effect of factor1 differs across levels of factor2 (interaction is non-zero).

Parameter tested: set of cell means {μ_{ij}} and their marginal/interaction decomposition

Assumptions (and what to do if they fail)

No significant outliers in any cell of the factor1 × factor2 designmedium

Check: Inspect per-cell boxplots in the cell-grid figure; flag points beyond the whiskers.

If violated: Outliers within a cell can inflate the within-cell variance and distort F-tests, especially in small cells.

Residuals (deviations from cell means) are approximately normally distributedmedium

Check: Shapiro-Wilk on residuals; inspect the residual Q-Q plot.

If violated: Severely non-normal residuals threaten the F-test's nominal Type I error rate, especially with unbalanced designs and small cells.

Homogeneity of variances across all cells of the design (Levene's test on cells)medium

Check: Levene's test on the cell partition.

If violated: Unequal variances inflate Type I error, especially with unbalanced cell counts.

Balanced (or approximately balanced) cell sizeslow

Check: max_cell_n / min_cell_n ≤ 1.5 → effectively balanced.

If violated: Unbalanced designs inflate the influence of cell-size differences and make the SS decomposition order-dependent.

Ready to run a Two-Way ANOVA (factorial A × B) on your own data?

Guided setup, automatic assumption checks, effect sizes, figures and an APA write-up.

Run this test →