Mediation Analysis — Hayes/PROCESS Model 4

Dr. R. Düsing · University of Osnabrück
Example
XSelf-regulation ability (SRQ score, standardized) MWeekly study time (hours/week) — mediator YExam performance (points, 0–100)
Does self-regulation affect performance because it increases study time (indirect path a·b)? Or is there also a direct effect c′ — e.g. through more efficient studying?
Model equations — Hayes/PROCESS Model 4
M = i₁ + a·X + ε₁ (Model 1: mediator)
Y = i₂ + c′·X + b·M + ε₂ (Model 2: direct effect)
Y = i₃ + c·X + ε₃ (Model 3: total effect — without M)
Total effect: c = c′ + a·b  ·  Indirect effect: a·b
Path Diagram
a = — b = — c′ = — c (total) = — X M Y
Pop: —
c′ — Direct Effect
Pop: —
c — Total Effect
Pop: —
Regression Output — Outcome: M
Par.PopulationEstimated SEtp 95% CIInterpretation
R²(M) = Citation: Hayes, A. F. (2022). Introduction to mediation, moderation, and conditional process analysis (3rd ed.). Guilford.
Regression Output — Outcome: Y
Par.PopulationEstimated SEtp 95% CIInterpretation
R²(Y) =
Regression Output — Total Effect: Y ~ X (without mediator)
Par.PopulationEstimated SEtp 95% CIInterpretation
R²(c-model) = Model 3: bivariate regression Y ~ X, without M — estimates c = c′ + a·b directly
Indirect Effect a·b
Analytical Tests
Test Population a·b Estimated a·b SE(a·b) z p (2-tailed)
Sobel: SE = √(b²·SE_a² + a²·SE_b²)  ·  Aroian: SE = √(b²·SE_a² + a²·SE_b² + SE_a²·SE_b²)
Bootstrap Confidence Interval
Percentile method · 5000 iterations · on request only (Hayes, 2022, 3rd ed., Ch. 4)
Concepts
What is mediation?
A mediator M explains the mechanism through which X affects Y. X influences M (path a), M influences Y (path b). The indirect effect a·b quantifies this process. Hayes (2022) calls this the simplest mediation model — PROCESS Model 4.
Direct vs. indirect effect
The direct effect c′ is the X→Y influence with M held constant. The indirect effect a·b runs through M. Together they give the total effect c = c′ + a·b — identical to the simple bivariate coefficient of X on Y with M omitted from the model.
Mediation, confounding & suppression
MacKinnon, Krull & Lockwood (2000, Prevention Science) show: mediation, confounding and suppression are mathematically equivalent — the same equations, different causal interpretations. Under suppression, a and b have opposite signs: a·b is negative, so |c′| > |c| — the direct effect overestimates the total effect. This is visible in Scenario D: X and Y correlate more weakly than X's direct effect on Y, because M suppresses part of the X effect. Whether M is a mediator, confounder or suppressor is decided by causal theory, not by the data.
Sobel test & limitation
The Sobel test (1982) tests H₀: a·b = 0 via z = ab/SE with SE = √(b²SE_a² + a²SE_b²). The product of two normally distributed random variables is not normally distributed — it follows a product distribution that is typically skewed and leptokurtic. The Sobel test therefore often underestimates significance at small n (too conservative) and can fail to correctly control the α error for certain parameter combinations. The Aroian test adds the term SE_a²·SE_b² and is somewhat more accurate, but suffers from the same underlying problem.
Why bootstrap is better
The bootstrap CI makes no distributional assumption for a·b. Instead, it approximates the sampling distribution empirically: B=5000 resamples deliver the actual shape of the a·b distribution — including skew and kurtosis. At small n, or when a and b are similar in size, the distribution of a·b is strongly asymmetric; the Sobel CI is then too narrow or off-center on the wrong side. Preacher & Hayes (2004, 2008) show in simulations: bootstrap has better power and more correct α control. The percentile CI [2.5%, 97.5%] is the minimum; the BCa CI (bias-corrected, accelerated) would be even more robust, but at n ≥ 100 is usually identical.
Causal mediation analysis
Regression mediation describes a pattern but does not prove causation. A finding of a·b ≠ 0 can arise because M truly mediates — or because a third variable jointly influences M and Y (confounding). Causal claims require two conditions: (1) all confounders between X and Y are controlled (ideally: X is randomized). (2) all confounders between M and Y are measured — this is the harder condition and often unattainable in practice. DAGs make visible which variables could even qualify as confounders. The potential-outcomes framework (PO) precisely defines what "causal indirect effect" means: how does Y change if the path through M is interrupted? IPW estimates this effect, provided the assumptions hold (Imai et al., 2010; VanderWeele, 2015). Whether the assumptions hold is a theoretical decision — not an empirical one.

Related tools: DAGs (Golem Builder) and G-Computation (GComp Builder) in the Bayes Thinking Lab, as well as Causal Inference — Foundations and Propensity Score Matching / Weighting here in Methods Lab.
Mediation Analysis — Help
Example

The tool shows an example from learning psychology: self-regulation (X) → study time (M) → exam performance (Y). The parameter sliders control the true population effects; the tool simulates a sample from these and estimates the coefficients.

Model structure (Hayes Model 4)

A mediation analysis decomposes the total effect of X on Y into two paths:

Indirect effect: a·b  (X→M→Y)
Direct effect: c′  (X→Y, with M held constant)
Total effect: c = c′ + a·b

c corresponds exactly to the bivariate regression coefficient from the simple regression Y ~ X (with M omitted from the model).

Four scenarios

A — No mediation: a·b ≈ 0, because a or b is zero. X affects Y directly, but not through M.
B — Full mediation: c′ ≈ 0, the entire effect runs through M. Without M in the model, c ≠ 0 — but once M is controlled for, it vanishes.
C — Partial mediation: both a·b and c′ are nonzero. The most common case in practice.
D — Suppression: a and b have opposite signs, so a·b is negative. Since c = c′ + a·b, the total effect turns out smaller than the direct one: |c| < |c′|. Under strong suppression, c can be near zero even though c′ is substantial.

Sobel test vs. bootstrap

The Sobel test assumes that a·b is approximately normally distributed. That only holds at large n — at small sample sizes, the product distribution is skewed and leptokurtic, which makes the test too conservative.

The bootstrap CI (Preacher & Hayes, 2008) makes no distributional assumption: 5000 resamples approximate the actual shape of the a·b distribution. In simulations it has better power and more correct α control — especially at n < 100 or with asymmetric effects.

Causality

A significant a·b does not prove causation. Causal claims require (1) all confounders between X and Y and (2) all confounders between M and Y to be controlled. Condition 2 is rarely attainable in observational studies. DAGs help identify the necessary control variables.

Further Reading

Baron, R. M. & Kenny, D. A. (1986). The moderator-mediator variable distinction in social psychological research. JPSP, 51(6), 1173–1182.
Preacher, K. J. & Hayes, A. F. (2008). Asymptotic and resampling strategies for assessing and comparing indirect effects in multiple mediator models. Behavior Research Methods, 40(3), 879–891.
MacKinnon, D. P., Lockwood, C. M., Hoffman, J. M., West, S. G. & Sheets, V. (2002). A comparison of methods to test mediation and other intervening variable effects. Psychological Methods, 7(1), 83–104.
Hayes, A. F. (2022). Introduction to Mediation, Moderation, and Conditional Process Analysis (3rd ed.). Guilford.