Two-Way ANCOVA (factorial + covariate)

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…

Two-factor between-subjects ANOVA that statistically adjusts for one or more continuous covariates.

Reduces residual variance, increases power on the main effects and interaction, and removes confounding from baseline differences. Reports the same 3-F-test family as 2-way ANOVA (Factor A, Factor B, A×B) plus the covariate's regression slope. Critically requires the homogeneity-of-regression-slopes assumption — covariate × factor interactions must be NS for the adjusted comparisons to be interpretable.

Worked example

Do method and sex affect exam score after adjusting for prior ability?

A two-way ANCOVA on exam score with Method × Sex, adjusting for a prior-ability covariate.

Result

The main effect of method remained significant after covariate adjustment, F(2, 83) = 6.2, p = .003.

How you'd report it (APA)

A two-way ANCOVA showed a significant main effect of method on exam score after controlling for prior ability, F(2, 83) = 6.2, p = .003.

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

When to use it

  • Factorial design with baseline-adjusted outcome
    A 2 (Therapy: CBT vs Mindfulness) × 2 (Format: in-person vs online) RCT measures depression at baseline and 8 weeks.
  • Factorial observational design with confounder adjustment
    Comparing job-satisfaction across 2 (Department: engineering vs sales) × 3 (Region: NA, EU, APAC) while controlling for tenure (years at company), which differs systematically by r

When NOT to — use instead

Hypotheses

Three null hypotheses: (1) H₀_A: no main effect of IV1 (adjusted); (2) H₀_B: no main effect of IV2 (adjusted); (3) H₀_AB: no IV1 × IV2 interaction (adjusted). Each tests equality of adjusted population means at the grand covariate mean.
Hₐ for each of the three effects: at least one adjusted mean differs.

Parameter tested: adjusted cell means {μ_adj[i,j]} of the DV at the grand covariate mean

Assumptions (and what to do if they fail)

No significant outliers on the DV within each IV1 × IV2 cellmedium

Check: Inspect per-cell boxplots of the DV.

If violated: Outliers distort within-cell variance and the covariate-adjusted F-tests.

Model residuals are approximately normally distributedmedium

Check: Shapiro-Wilk on residuals.

If violated: Severely non-normal residuals threaten the F-test's Type I error rate.

Homogeneity of variance on the DV across IV1 × IV2 cells (Levene's test)medium

Check: Levene's p > .05 → variances homogeneous across cells.

If violated: Unequal cell variances inflate F-test Type I error.

Linear relationship between the DV and the covariate within each IV1 × IV2 cellmedium

Check: Per-cell scatter with linear fit; verify no obvious curvature.

If violated: Non-linear DV-covariate relationships produce biased adjusted means.

The DV–covariate slope is the same across all IV1 × IV2 cells (no IV × covariate interactions)high

Check: All covariate-interaction terms' p > .05 → slopes homogeneous.

If violated: If slopes differ across cells, a single 'adjusted' comparison is not meaningful; the IV effect depends on the covariate value.

The covariate's mean does not differ across IV1 × IV2 cells (by construction in randomised designs)medium

Check: All F-tests in the covariate ANOVA p > .05 → groups equivalent on the covariate.

If violated: If the covariate differs across cells and is on the causal path of the IVs, ANCOVA may remove part of the treatment effect (Lord's paradox).

Ready to run a Two-Way ANCOVA (factorial + covariate) on your own data?

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

Run this test →