Mediation analysis estimates how much of an intervention's effect may pass through a proposed intermediate variable. It can clarify a causal theory, but it does not prove a biological or behavioral mechanism merely because an indirect-effect estimate is statistically significant.
Key points#
- The total effect can be decomposed into a direct effect and an indirect effect through a named mediator.
- Randomizing treatment does not randomize the mediator, so mediator-outcome confounding remains a central threat even in a trial.
- The mediator must occur after the intervention and before the outcome, with measurement times that support that sequence.
- Treatment-mediator interaction changes how direct and indirect effects should be defined and combined.
- A percentage “mediated” is often less informative than effect estimates, uncertainty intervals, assumptions, and sensitivity analyses.
A pathway claim asks more than an effect claim#
Suppose a structured activity program improves a mobility score. A mediation analysis might ask whether the improvement occurred through increased leg strength. The treatment is the program, strength is the proposed mediator, and mobility is the outcome.
The ordinary treatment comparison asks whether assignment to the program changed mobility. The mediation question is harder: how would mobility have differed if the program changed strength as observed, compared with a hypothetical situation in which strength stayed at the level it would have reached without the program?
That second question combines observations with counterfactual states that cannot all be seen in the same person. Statistical models can estimate those contrasts, but only after assumptions connect observed data to the hypothetical comparisons. A convincing pathway therefore needs a clear causal model, not just an extra regression term.
Direct, indirect, and total effects#
The total effect is the overall contrast between the intervention and comparison conditions. The indirect effect is the portion attributed to changes in the mediator. The direct effect covers routes that do not pass through that mediator.
Modern causal methods distinguish several versions of these effects. A controlled direct effect compares treatment conditions while setting the mediator to one specified value for everyone, and a natural direct effect instead holds the mediator at the value it would have taken under a reference condition. A natural indirect effect changes the mediator between the values it would have taken under the two treatment conditions while holding treatment fixed.
These are different scientific questions, and they can require different assumptions. A paper should make clear which estimand it calculated, rather than treat “direct effect” as a self-defining label.
The pieces do not always combine by simple addition. The scale matters, such as risk difference, risk ratio, or odds ratio, and so does interaction between treatment and the mediator. If the intervention changes both the mediator and the mediator's relationship with the outcome, methods that assume no interaction can give a distorted decomposition.
Why randomization solves only part of the problem#
Random assignment can protect the treatment-outcome comparison from baseline confounding. It does not assign participants to mediator values. Leg strength in the example may also reflect baseline frailty, nutrition, pain, adherence, or an illness that affects mobility. If these common causes are incompletely measured, the mediator-outcome association can be mistaken for a causal route.
A causal interpretation commonly requires support for all of the following:
- No unmeasured common causes of treatment and outcome.
- No unmeasured common causes of treatment and mediator.
- No unmeasured common causes of mediator and outcome after accounting for treatment.
- No mediator-outcome confounder that was itself changed by treatment, unless the chosen method can handle that structure.
The fourth condition is easy to overlook. Imagine that the program reduces pain, pain affects both strength testing and mobility, and pain occurs after treatment. Adjusting for pain may block part of the treatment effect or introduce selection bias. Not adjusting may leave mediator-outcome confounding. Standard natural-effect methods do not automatically solve this treatment-induced confounding problem.
Timing determines whether the arrows make sense#
A variable cannot explain a later outcome if it was measured after that outcome. Yet studies sometimes assess a proposed mediator and outcome at the same follow-up visit. The data may show correlation, but they cannot establish which changed first.
Repeated measurements can help define the sequence, although they introduce choices about which time point represents the mediator and how prior outcome values enter the model; the protocol should state when the mediator begins, when it is measured, when the outcome is assessed, and why the interval is clinically plausible.
Measurement error matters too. A noisy mediator can weaken an indirect-effect estimate and redirect apparent effect into the direct component; if the mediator is a multi-item score, you want reliability, validation, missing-item rules, and evidence that the same measurement process was used in each group. Dichotomizing a continuous mediator, such as calling strength simply “improved” or “not improved,” discards information and makes the result depend on a threshold.
Why “proportion mediated” can mislead#
The proportion mediated is often calculated by dividing the indirect effect by the total effect. Its intuitive appeal can exceed its stability.
If the total effect is close to zero, the ratio can become extremely large or change sign with a small numerical shift. If direct and indirect effects point in opposite directions, sometimes called inconsistent mediation, the percentage may be negative or exceed 100%. On nonlinear scales, the decomposition can also depend on model form. So a result such as “60% of the effect was mediated” should not stand alone: what you want is the total, direct, and indirect estimates on a stated scale, each with its uncertainty interval, followed by an explanation of assumptions and robustness checks.
Sensitivity analysis is part of the result#
Unmeasured mediator-outcome confounding cannot be ruled out by a conventional p value. Sensitivity analysis asks how strong such confounding would need to be to change the conclusion. Different methods express that strength differently, but the purpose is the same: show whether the pathway claim survives modest departures from the main assumptions.
Other checks can vary the timing definition, mediator model, outcome model, treatment-mediator interaction, handling of missing data, and adjustment set. Agreement across reasonable specifications is reassuring. Disagreement is informative because it shows that the mechanism claim is model dependent. A sensitivity analysis cannot certify that the causal diagram is correct. It makes the consequences of uncertainty visible.
A reader's mediation checklist#
The AGReMA guideline was developed to improve reporting of mediation studies. Its principles turn into a practical list you can run down:
- Is the proposed pathway shown in words or a causal diagram?
- Are treatment, mediator, outcome, and their measurement times defined?
- Is the direct or indirect effect estimand named, including its scale?
- Were mediator selection and the analysis plan specified before results were examined?
- Which variables were treated as confounders, and why?
- Could treatment have changed any mediator-outcome confounder?
- Was treatment-mediator interaction evaluated?
- Are missing mediator and outcome data described?
- Are effect estimates and uncertainty intervals reported, not only a mediated percentage?
- Does a sensitivity analysis challenge the no-unmeasured-confounding assumption?
The language of the conclusion should match the design. A well-conducted observational analysis can support a pathway hypothesis. A randomized treatment comparison with careful mediation methods can strengthen that hypothesis. Neither justifies saying that the mediator has been proven unless the causal assumptions are unusually well supported.
Sources and further reading
Questions and answers
Does a significant indirect effect prove mechanism?
No. Statistical significance addresses sampling uncertainty under the fitted model. It does not verify temporal order, measurement validity, the causal diagram, or absence of hidden confounding.
Can mediation be studied in a randomized trial?
Yes, but randomization protects the treatment assignment, not the mediator. The mediator-outcome part of the analysis still needs strong assumptions and robustness checks.
Is a larger proportion mediated always more persuasive?
No. The ratio can be unstable or difficult to interpret. Direct and indirect effect estimates, their scales and intervals, and the sensitivity analysis are more useful than the percentage alone.