Moderation (2-level Mod × continuous IV) — interaction + simple slopes

Verified

Advanced & specialized

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 whether the linear effect of a continuous predictor (IV) on a continuous outcome (y) DIFFERS across two levels of a dichotomous moderator (Mod).

Reports the interaction coefficient β_int with SE, 95% CI and p-value as the headline test of moderation; the ΔR² of adding the interaction to the additive y ~ IV + Mod model; and per-moderator-level simple slopes (β, SE, 95% CI, p) for the IV → y relationship. Centres the IV before forming the interaction term to reduce multicollinearity and ease coefficient interpretation.

Worked example

Does the effect of X on Y depend on a continuous moderator W?

A moderation model regresses Y on X, W and their product; a significant X×W term means the X-effect changes with W, probed via simple slopes.

Result

The X × W interaction was significant, b = 0.18, p = .009; simple slopes showed X predicted Y at high W but not low W.

How you'd report it (APA)

Moderation analysis showed a significant X × W interaction, b = 0.18, p = .009, with X predicting Y only at higher levels of W.

When to use it

  • Continuous IV × dichotomous moderator on continuous y
    Stress reactivity (y) ~ caffeine dose (IV) × treatment group (Mod, n = 80).
  • Dose-response with subgroup moderator
    BP reduction (y) ~ baseline severity (IV) × drug arm (active/placebo) (n = 200 RCT).

When NOT to — use instead

Hypotheses

H₀: β_int = 0 (no moderation — the slope of IV on y is the same across both moderator levels).
Hₐ: β_int ≠ 0 (the slope of IV on y differs across moderator levels).

Parameter tested: β_int — the interaction coefficient (slope difference)

Assumptions (and what to do if they fail)

Interaction coefficient β_int is statistically significant. p < .05 confirms moderation; non-significance means the slope of IV on y is statistically the same across moderator levels.high

Check: p-value of IV:Mod term.

If violated: No moderation detected — the simpler additive model y ~ IV + Mod is more defensible.

Residuals of the full interaction model are approximately normally distributed (CLT protects for n ≥ 100).medium

Check: Shapiro-Wilk p-value.

If violated: Non-normal residuals affect small-n CIs / p-values.

Residual variance is approximately constant across the fitted values (and across moderator levels). Heteroscedasticity inflates SEs on β_int and the simple slopes.high

Check: Breusch-Pagan p-value on the full model.

If violated: Heteroscedasticity → SE on β_int is anti-conservative.

Each moderator level has ≥ 20 cases. Imbalanced or sparse subgroups inflate the SE of the simple slope at the smaller level.medium

Check: min(n_mod=0, n_mod=1).

If violated: Small subgroup → wide CI on the simple slope at that level → moderation conclusion may be unstable.

Ready to run a Moderation (2-level Mod × continuous IV) — interaction + simple slopes on your own data?

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

Run this test →