- Introduced by
- Yuan & MacKinnon (Bayesian mediation); Hayes (conditional process framework)
- Year
- 2009–2013
- Type
- Conditional indirect effect model
- Family
- Multivariate analysis
What does it do?
Bayesian moderated mediation estimates how a mediator transmits the effect of a predictor onto an outcome, and whether that indirect effect varies in size depending on a moderator variable — all within a Bayesian framework that quantifies uncertainty via posterior distributions rather than p-values and confidence intervals.
The intuition behind the method
Classical moderated mediation asks whether the mediated pathway from X to Y through M grows stronger or weaker depending on a third variable W. The Bayesian version asks the same question but combines prior information with the observed data to build a probability distribution over each parameter, including the conditional indirect effect at different values of W. Instead of a binary significant or not-significant verdict, the analyst obtains a credible interval that states how much posterior probability falls over each range of effect sizes. Yuan and MacKinnon (2009) argue that the Bayesian approach allows prior information to be incorporated and that its inference is straightforward and exact, conditional on the specified model and priors, which they note is appealing for studies with small samples.
History
Yuan and MacKinnon (2009) proposed Bayesian analysis of mediation effects and argued that it allows prior information to be used, and that inference is straightforward and exact conditional on the model and priors, which is useful for small samples. That article addresses mediation only; it does not cover moderation or conditional indirect effects.
When to use it
Choose Bayesian moderated mediation when the research question is a conditional process question (does the indirect effect of X on Y through M vary with W?), the causal ordering of X, M and W is justified by the design, and you want the full posterior of each conditional indirect effect rather than a bootstrap interval. It is a reasonable choice when substantive prior information is available and should be incorporated, or when you want direct probability statements about the indirect effect at several values of W. The a×b product is not normally distributed, which is one reason posterior summaries are attractive here. Do not use it when the temporal or causal ordering of X, M and W is ambiguous, when the data are too sparse for the number of parameters so that the prior would dominate the estimates, or when the audience and reviewers are unfamiliar with Bayesian reporting and a frequentist conditional process analysis answers the question adequately.
Limitations and considerations
- Requires explicit prior specification; poorly chosen priors can distort the conditional indirect effect, particularly when the sample is small relative to the number of parameters.
- Computation is heavier than for least-squares estimates; Hamiltonian Monte Carlo can take a long time for complex conditional process models with several moderators or multiple outcomes.
- Bayesian reporting conventions (HDIs, posterior probabilities, Bayes factors) are less familiar to many applied researchers and reviewers, which can complicate publication.
- Causal interpretation of the indirect effect depends on the research design; the Bayesian framework does not by itself remove confounding of the X–M, M–Y or X–Y relations.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Provides a full posterior distribution for the conditional indirect effect, allowing direct probability statements about its size at any value of W.
- Propagates uncertainty through the product of the a-path and b-path at each MCMC iteration, so no separate bootstrap or delta-method step is needed.
- Can incorporate prior knowledge from earlier studies, which Yuan and MacKinnon (2009) present as a way to improve estimation efficiency.
- Yuan and MacKinnon (2009) describe the Bayesian approach as conceptually simpler for multilevel mediation analysis, so the same framework extends to multilevel structures.
Applications
- Organisational psychology: testing whether the indirect effect of leadership style on employee performance, through engagement, is stronger for workers with high autonomy.
- Health psychology: examining whether the pathway from stress to health outcomes through coping behaviour depends on the level of social support.
- Marketing research: assessing whether attitude-mediated effects of advertising on purchase intention vary by product involvement.
- Educational research: evaluating whether the effect of a classroom intervention on learning outcomes, through self-efficacy, differs across levels of prior achievement.
- Clinical psychology: determining whether the indirect effect of cognitive restructuring on depression, through rumination, varies by trait mindfulness.
How it works
How it works
The mediator M is regressed on the predictor X, the moderator W, and their product term XW. The coefficient on XW indicates whether the X-to-M path (the a-path) changes with W, which is what makes the a-path moderated.
Formula
M = a_0 + a_1 X + a_2 W + a_3 XW + \varepsilon_M
The outcome Y is regressed on M, X, W, and optionally the product MW. The coefficient on M gives the b-path; if MW is included, its coefficient indicates whether W moderates the b-path. Together the two equations form a conditional process model.
Formula
Y = b_0 + b_1 M + b_2 X + b_3 W + b_4 MW + \varepsilon_Y
The conditional indirect effect at a given value of W is the product of the conditional a-path and the conditional b-path. From the two equations above, the a-path at W is a1 + a3·W, the slope of X on M at that value of the moderator, and the b-path at W is b1 + b4·W, the slope of M on Y (with b4 set to zero if MW is omitted). The conditional indirect effect is therefore (a1 + a3·W)(b1 + b4·W). In the Bayesian framework this quantity is a derived one: its posterior distribution is obtained by combining the sampled a and b values at each MCMC iteration, so uncertainty propagates without a separate delta-method or bootstrap step.
Formula
\text{IE}(W) = a_1(W) \cdot b_1(W)Priors are placed on the regression coefficients and residual variances. Weakly informative normal priors on coefficients and half-Cauchy priors on standard deviations are common defaults; they allow the data to dominate while limiting implausibly extreme estimates. Informative priors based on earlier studies can be used when such prior knowledge exists, and the choice should be reported and justified. Results should be re-estimated under alternative prior widths; if the conclusions about the conditional indirect effect change materially, they depend on the prior, and this should be stated.
A sampler such as Hamiltonian Monte Carlo (Stan, brms) or Gibbs sampling (JAGS) draws from the joint posterior. Convergence is checked with the Gelman-Rubin R-hat statistic and trace plots. The posterior of the conditional indirect effect is summarised by its median and a 95% highest-density interval (HDI); if the HDI excludes zero, the indirect effect is credibly non-zero at that value of W.
Common pitfalls
- Using flat or improper priors on variance parameters: these can produce non-convergent chains or unrealistically wide posteriors. Weakly informative half-normal or half-Cauchy priors on standard deviations are the safer choice.
- Ignoring convergence diagnostics: R-hat values clearly above 1 signal non-convergence, so a loose cut-off such as 1.05 should not be treated as a pass. Poor mixing in trace plots or a low effective sample size also means the posterior summaries are unreliable, however precise they look.
- Treating a 95% HDI that excludes zero as identical to a frequentist p < .05. The two are related but not the same; report the full HDI and the posterior probability for the quantity of interest.
- Leaving W and the product terms uncentred: the lower-order a- and b-path coefficients then refer to W = 0, which may lie outside the observed range, and the interpretation of the conditional effects becomes harder to read. State the centring convention explicitly.
- Reporting the conditional indirect effect at a single value of W: probe it across a meaningful range (for example mean ± 1 SD) and show the whole pattern, not one point estimate.
Frequently asked questions
How does Bayesian moderated mediation differ from the PROCESS macro approach?
Both estimate conditional indirect effects, but the PROCESS macro uses ordinary least squares with bootstrapped confidence intervals, while Bayesian moderated mediation samples from the full posterior. The Bayesian approach gives a direct probability statement about the indirect effect, at the cost of specifying priors and more computation.
Do I need a large sample for Bayesian moderated mediation?
There is no fixed threshold. Yuan and MacKinnon (2009) present the Bayesian approach as appealing for small samples, and informative priors from earlier studies can stabilise estimates when data are limited. With weak or flat priors the data carry more of the load, so the sample still needs to be adequate for the number of parameters in the model; a prior sensitivity check is advisable.
Which software implements Bayesian moderated mediation?
The model can be specified with the brms R package, an interface to Stan that fits multivariate regression models with full Bayesian inference. Alternatively, the model can be coded directly in Stan or in JAGS. The choice depends on how comfortable you are with model specification and sampler diagnostics.
How do I report Bayesian moderated mediation results?
Report the posterior median (or mean) and 95% highest-density interval for each path coefficient and for the conditional indirect effect at substantively meaningful values of the moderator. Include the R-hat convergence statistic and the effective sample size. A plot of the conditional indirect effect against W with its HDI band is usually the most informative display.
What is the difference between moderated mediation and mediated moderation?
Both describe a model in which mediation and moderation occur together, but they emphasise different quantities. Moderated mediation focuses on how the indirect effect changes across levels of W, so the conditional indirect effect is the main estimand. Mediated moderation focuses on whether a moderation effect is itself explained by a mediator. The distinction is conceptual and guides which parameters to highlight.
Related methods
Sources
Yuan, Y. & MacKinnon, D. P. (2009). Bayesian mediation analysis. Psychological Methods, 14(4), 301–322.
Open DOI referenceHayes, A. F. (2013). Introduction to Mediation, Moderation, and Conditional Process Analysis: A Regression-Based Approach. Guilford Press.
ISBN: 978-1609182304