Mediation
Purpose:
Mediation tests whether the effect of an IV (X) on a DV (Y) operates through a third variable — the mediator (M). Rather than asking whether X affects Y, mediation asks why or how X affects Y.
Mediation vs. moderation: A mediator explains the mechanism (how X affects Y). A moderator changes the strength of that effect (when or for whom X affects Y). These are different questions requiring different analyses.
Understanding the Paths:
Before interpreting output, it helps to know what each path label means:
| Path | What it represents |
|---|---|
| a | X → M: Does the IV predict the mediator? |
| b | M → Y (controlling for X): Does the mediator predict the DV? |
| c | X → Y (total effect, ignoring M) |
| c' | X → Y (direct effect, controlling for M) |
| a × b | Indirect effect: the portion of X's effect on Y that goes through M |
The key test in mediation is whether the indirect effect (a × b) is significant, determined by bootstrapped confidence intervals that exclude zero.
Context Used:
- ONE continuous IV (X), ONE continuous mediator (M), ONE continuous DV (Y)
- A theoretically justified causal order: X causes M causes Y
Do NOT use mediation if: You lack a theory-driven causal order — three correlated variables do not constitute mediation | Your sample is small (N < 100 for simple mediation) | All variables are measured at the same time point — cross-sectional mediation cannot confirm causation
Jamovi Walkthrough:
Requires the medmod module. Install via Modules → jamovi library → search "medmod."
- Click "medmod" → "Mediation"
- Move the IV (X) into the "Predictor" box
- Move the mediator (M) into the "Mediator" box
- Move the DV (Y) into the "Outcome" box
- Under "Estimates," check "Path coefficients," "Indirect effect," and "Confidence intervals"
- Set bootstrapping to at least 5,000 samples
R Walkthrough:
library(lavaan)
med_model <- '
Y ~ c * X
M ~ a * X
Y ~ b * M
indirect := a * b
total := c + (a * b)
'
med_fit <- sem(med_model, data = df, se = "bootstrap", bootstrap = 1000)
summary(med_fit, fit.measures = TRUE)
Note on total effect: A significant total effect (path c) is no longer required before testing mediation under current best practices (Hayes, 2018). The indirect effect can be significant even when the total effect is not.
Output Interpretation:
Indirect effect (a × b): The critical output. If the bootstrapped 95% CI does not include zero, the indirect effect is significant and mediation is supported.
Types of mediation:
- Full mediation: Path c was significant before adding M, but the direct effect (c') becomes non-significant after M is included. M fully accounts for the X → Y relationship.
- Partial mediation: The direct effect (c') remains significant after adding M but is reduced in magnitude. Both a direct path and an indirect path through M exist. This is the more common finding in psychology research.
Whether mediation occurred is determined by the indirect effect CI excluding zero — not by the percentage of variance explained alone.
APA Format:
Appropriate data visualization: Path diagram labeling the a, b, c, and c' paths with coefficients.
Sample write-up:
A mediation analysis tested whether [M] mediated the relationship between [X] and [Y]. The indirect effect was statistically significant, B = , 95% CI [, ], indicating that [X] predicted [M] (path a: B = , p = ), which in turn predicted [Y] controlling for [X] (path b: B = , p = ). The direct effect of [X] on [Y] [was/was not] significant after accounting for [M] (path c': B = , p = ), suggesting [full/partial] mediation.