Mediation Analysis

Statistics
Introduced by
Baron & Kenny
Year
1986
Type
Indirect effects / path test

What does it do?

Mediation analysis tests whether the effect of an independent variable X on an outcome Y operates wholly or partly through a third variable M, the mediator.

As formalised by Baron and Kenny in 1986, it splits the total effect of X on Y into a direct path (c′) and an indirect path (a × b). The indirect path quantifies how much of the relationship is carried by the mediating mechanism.

The intuition behind the method

Imagine you find that students who receive coaching score higher on exams. Mediation analysis asks: is coaching working directly, or is it working because coaching boosts self-confidence, and that confidence then drives exam performance? Rather than simply linking the cause to the outcome, the analysis inserts the mediator into the chain and measures how much of the effect travels through it. If the indirect path a × b is reliably non-zero (its bootstrap confidence interval excludes zero), you have evidence of mediation.

History

The causal-steps approach to mediation was systematised by Baron and Kenny in their 1986 paper in the Journal of Personality and Social Psychology, and their procedure was widely applied in social and health research. Preacher and Hayes (2008) examined asymptotic and resampling strategies for assessing and comparing indirect effects in multiple mediator models. In the wider methodological literature, bootstrap confidence intervals for the product a × b came to be preferred over the Sobel test. Hayes's PROCESS macro made bootstrap mediation and conditional process analysis accessible to users of SPSS, SAS and R, and Hayes's regression-based textbook (third edition, 2022) is cited on this page as a general reference.

When to use it

Choose mediation analysis when theory proposes a causal chain X → M → Y and the question is whether M accounts for the X–Y relationship. All three variables must be measured, and the causal ordering must be justified by theory or study design, because the regression estimates cannot establish it. The standard approach is written for continuous outcomes; binary or ordinal variables need model extensions. No fixed minimum sample size is established by the cited sources. In practice, stable bootstrap intervals for the indirect effect generally require roughly 200 or more cases, and when the expected indirect effect is small, a Monte Carlo power analysis can help plan the sample size. Before interpreting results, check that the following assumptions are reasonable: (1) the relationships of X to M and of M to Y are linear, and the residuals of each sub-model have been inspected; (2) there is no X × M interaction in predicting Y, since its presence calls for a moderated mediation model; (3) confounders of the X–M and M–Y associations have been measured and controlled, because unmeasured confounding of either path biases the indirect effect; (4) the causal ordering X → M → Y is justified by theory or study design; (5) predictors are not severely multicollinear; and (6) the sample is large enough for stable bootstrap intervals. Do not use the method when no plausible mediator exists or when the proposed mediator is measured after the outcome.

Limitations and considerations

  • Establishes statistical mediation but not causal mediation unless the study design (e.g. experimental manipulation of M) rules out confounding of the M → Y path.
  • The product a × b assumes no interaction between X and M in predicting Y; violations require moderated mediation models.
  • Requires a minimum sample size (around 50, preferably 200+) for reliable bootstrap estimates; small samples produce wide, uninformative confidence intervals.
  • Temporal ordering — X precedes M precedes Y — must be established conceptually or by study design, not by the analysis itself.

Source conditions do not replace independent scientific review or validation by an analysis engine.

Strengths

  • Splits the total effect c into a direct path c′ and an indirect path a × b, so the share of the effect carried by M can be estimated and reported.
  • Bootstrap intervals for a × b do not rely on the normal approximation used by the Sobel test, which matters because a product of two regression coefficients is typically skewed.
  • Extends to multiple mediators, moderated mediation and latent-variable models within structural equation modelling frameworks.
  • Available in several software environments, including the PROCESS macro, which implements bootstrap mediation and conditional process analysis.

Applications

  • Social and health psychology: testing whether an intervention changes behaviour through a specific psychological mechanism (e.g. self-efficacy mediating the effect of training on performance).
  • Epidemiology and public health: decomposing the effect of an exposure on a health outcome into pathways through biological or behavioural intermediates.
  • Education research: examining whether instructional methods improve learning outcomes through changes in motivation or engagement.
  • Marketing and organisational behaviour: testing whether customer satisfaction mediates the effect of service quality on loyalty, or whether job autonomy mediates the effect of leadership on performance.
  • Clinical research: understanding whether a treatment reduces symptoms through changes in a targeted cognitive or physiological mechanism.

How it works

How it works

1

The null hypothesis states that the indirect effect, the product of path a (the effect of X on M) and path b (the effect of M on Y, controlling for X), equals zero, meaning M does not carry any of X's influence to Y. The alternative hypothesis asserts that this product is non-zero, indicating that at least part of X's effect on Y flows through the mediator.

Formula
H_0:\ a \times b = 0 \quad H_1:\ a \times b \neq 0
2

The indirect effect is estimated as the product a × b, where a is the unstandardised regression coefficient from regressing M on X, and b is the regression coefficient for M in the model regressing Y on both X and M simultaneously. Bootstrap resampling (typically 5 000 draws) generates an empirical sampling distribution of this product, yielding a confidence interval that is robust to the non-normality of indirect effects. The direct effect c′ is the coefficient for X in that same Y-model, and the total effect c equals a × b + c′.

Formula
\text{Indirect effect} = a \times b = \hat{\beta}_{XM} \cdot \hat{\beta}_{MY|X}
3

If the 95% bootstrap confidence interval for the indirect effect a × b does not include zero, the null hypothesis is rejected and statistical mediation is supported. Results should not be classified as full or partial mediation. That labelling rests on whether the direct effect c′ remains significant, a causal-steps procedure that most experts in mediation analysis no longer recommend. Report the unstandardised indirect effect with its bootstrap confidence interval as the primary effect size. The proportion of the total effect mediated (a × b / c) or the standardised indirect effect can be added as secondary measures. The proportion is unreliable when c is close to zero or when the indirect and direct effects have opposite signs, and it is hard to interpret when the total effect is not significant.

Formula
\text{reject } H_0 \text{ if bootstrap 95\% CI for } a{\times}b \text{ excludes } 0

Common pitfalls

  • Inferring causation from cross-sectional mediation results — the analysis can only test the consistency of a causal model, not establish it.
  • Relying on the Sobel test instead of bootstrap intervals. The Sobel test assumes the indirect effect is normally distributed, which is often violated because a × b is typically skewed, so bootstrap intervals are generally preferred.
  • Omitting effect size reporting: always report the unstandardised indirect effect and its bootstrap CI. Report the proportion of the total effect mediated only as a secondary measure, with the caveats about small c and opposite-signed effects.
  • Failing to check or control for confounders of the M → Y relationship, which can produce spurious or suppressed mediation findings.

Frequently asked questions

Should results be described as full or partial mediation?

Full mediation (the direct effect c′ becomes non-significant once the mediator is included) and partial mediation (c′ remains significant but smaller than the total effect c) are labels from the causal-steps approach. Most experts in mediation analysis no longer recommend using them, and the distinction depends heavily on sample size. Report the unstandardised indirect effect a × b and its bootstrap confidence interval, together with the direct effect c′, and describe what the interval shows rather than assigning a label.

Why is bootstrap preferred over the Sobel test?

The Sobel test approximates the sampling distribution of a × b as normal, which is inaccurate because the product of two regression coefficients is typically skewed, especially in moderate samples. Bootstrap resampling constructs an empirical distribution directly from the data without distributional assumptions, which yields confidence intervals that better reflect the skewed sampling distribution. With samples of 200 or more and 5 000 bootstrap draws, the percentile or bias-corrected accelerated (BCa) bootstrap interval is the recommended approach.

How large a sample do I need?

No fixed minimum sample size is established by the cited sources. Stable bootstrap confidence intervals for the indirect effect generally require roughly 200 or more cases, and larger samples make the test more likely to detect an indirect effect. When the anticipated indirect effect is small or the paths are weak, a power analysis using Monte Carlo simulation (available in specialised software) can determine the required N more precisely.

Can I use mediation analysis with non-continuous outcomes or mediators?

Yes, with appropriate extensions. When Y or M is binary, the model sub-components use logistic or probit regression. Hayes's PROCESS macro implements several such variants. For latent variables, structural equation modelling software such as lavaan (R) or Mplus handles mediation with full-information estimators. The core logic of decomposing total effects into direct and indirect components remains the same across these extensions.

Related methods

Sources

  1. Baron, R. M. & Kenny, D. A. (1986). The moderator-mediator variable distinction in social psychological research. Journal of Personality and Social Psychology, 51(6), 1173–1182.

    Open publication reference
  2. Hayes, A. F. (2022). Introduction to Mediation, Moderation, and Conditional Process Analysis: A Regression-Based Approach (3rd ed.). The Guilford Press.

    ISBN: 978-1462549030
  3. 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.

    Open DOI reference