Concept Architecture
Mediation Analysis of Direct and Indirect Effects in Health Economics
Mediation analysis asks how much of a treatment's effect on an outcome travels through a named intermediate variable and how much arrives by other routes. In health economics the intermediate is often a behaviour or a clinical marker, such as medication adherence or blood pressure, and the outcome is a cost, a QALY or a final clinical event. The answer matters to decisions because an effect that depends on a mediator changes when the mediator responds differently in routine practice. Modern practice, within causal inference, defines direct and indirect effects as counterfactual contrasts and states when regression estimates of them can be read causally, while the causal pathway page covers how such routes enter models.
Product of coefficients and the difference method
The traditional approach, popularised by Baron and Kenny in 1986 and often called the product method, fits two regressions. Valeri and VanderWeele write them for a continuous mediator and outcome, allowing for covariates and an exposure by mediator interaction.
where is the treatment level, the mediator value, the outcome, the covariates, the effect of treatment on the mediator, the treatment coefficient with the mediator held fixed, the mediator coefficient and the interaction. In the Baron and Kenny model is zero, the direct effect is and the indirect effect is , the familiar path-diagram identity, total effect equals , where and are path labels, not the treatment level and covariates, with , and .
The difference method takes the fall in the treatment coefficient when the mediator is added as the indirect effect. Valeri and VanderWeele note that the two methods are algebraically equivalent for ordinary least squares with continuous outcomes but diverge with a binary outcome and logistic regression. They also report a consensus that the total effect need not be significant for mediation to exist, since direct and mediated effects can have opposite signs.
Controlled and natural direct and indirect effects
The counterfactual framework defines the effects before any model is chosen. denotes the outcome a person would have under treatment with the mediator set to , and the mediator value that person would have under treatment .
where CDE is the controlled direct effect with the mediator fixed at for everyone, NDE is the natural direct effect with each person's mediator held at its untreated value, and NIE is the natural indirect effect of moving the mediator to its treated value with treatment held at 1. Hernán and Robins record that Robins and Greenland introduced the natural effects in 1992 as the pure direct and total indirect effects, and that Pearl called them natural. On the difference scale the NDE and NIE add up to the total effect even with interactions or non-linearities.
Under the conditions in the next section, and with both models correctly specified, the two regressions give the effects of treatment level against reference level at covariate level .
where the symbols are as defined above. With these collapse to the Baron and Kenny results. Valeri and VanderWeele note that controlled direct effects are often of more interest in policy evaluation, while natural effects suit questions about how mechanisms act.
Conditions for a causal reading
Valeri and VanderWeele list four conditions for a causal interpretation. They are no unmeasured confounding of treatment and outcome, of mediator and outcome, and of treatment and mediator, and no mediator-outcome confounder that is itself affected by treatment. The CDE needs only the first two, while the natural effects need all four.
The mediator-outcome condition is the one most often missed. Randomisation in a randomised controlled trial removes treatment-outcome and treatment-mediator confounding, but the mediator is not randomised, so more adherent patients may differ in frailty in ways that also drive costs. Valeri and VanderWeele note that Baron and Kenny did not mention this. The conditions also imply that treatment precedes the mediator and the mediator precedes the outcome.
Hernán and Robins object that pairs a treated outcome with an untreated mediator value in the same person, a cross-world quantity no experiment can confirm, whereas the CDE could in principle be identified by randomising both treatment and mediator.
Estimation, uncertainty and binary outcomes
Standard errors for these estimates come from the delta method or bootstrapping. In a Monte Carlo comparison of 14 tests, MacKinnon and colleagues found that the Baron and Kenny approach has low statistical power, and that testing the joint significance of the two component effects gave the best balance of Type I error and power.
With logistic models and a rare outcome, the natural effects are odds ratios whose product, not sum, gives the total effect. When the outcome is common, Valeri and VanderWeele explain that the non-collapsible odds ratio makes the difference method break down, and they suggest a log-linear model with effects on the risk ratio scale. Structural equation models also estimate direct and indirect effects and, on their account, can be useful when all relevant confounders are included.
Worked example with an adherence programme and annual NHS costs
All numbers in this example are illustrative. A randomised trial compares a pharmacist-led adherence programme for type 2 diabetes () with usual care (). The mediator is the proportion of days covered by prescriptions over six months, in percentage points, and the outcome is annual NHS cost per patient in GBP, including the programme's running cost. The fitted models are and , after adjustment for measured confounders of adherence and cost.
1. Adherence by arm. Mean adherence is 60 with usual care and 60 + 15 = 75 with the programme.
2. Total effect. Mean cost with the programme is 4,000 + 250 − 20 × 75 − 5 × 75 = GBP 2,375, and under usual care 4,000 − 20 × 60 = GBP 2,800, a total effect of minus GBP 425 per patient per year.
3. Natural direct effect. With adherence held at its usual-care value, programme cost would be 4,000 + 250 − 25 × 60 = GBP 2,750, so the NDE is 2,750 − 2,800, minus GBP 50.
where 250 is , minus 5 is and 60 is .
4. Natural indirect effect. Raising adherence by 15 points in the programme arm moves cost from GBP 2,750 to GBP 2,375.
where minus 20 is , 15 is and minus 5 is . The NDE and NIE sum to the total of minus GBP 425, and the share mediated is 375 / 425 = 0.88, or 88%. Taking alone would give minus GBP 300, missing the GBP 75 that arises because adherence saves more in the programme arm.
5. Controlled direct effect. With adherence fixed at 60 points the CDE is 250 − 5 × 60, minus GBP 50, at 80 points 250 − 5 × 80, minus GBP 150, and at 50 points zero.
6. Sensitivity to an unmeasured confounder. A binary factor , good self-management, is assumed to lower annual cost by GBP 200 at any treatment and adherence level () and, at the same adherence, to have a prevalence 0.25 lower in the programme arm (), where the programme produced part of the adherence. Under VanderWeele's simplifying assumptions the bias is in the NDE and in the NIE.
where is the between-arm difference in the prevalence of at fixed adherence and the effect of on cost. The corrected NDE is and the corrected NIE , so the share mediated falls to 325 / 425 = 0.76, or 76%, while the randomised total effect is untouched.
7. Transfer to routine practice. If routine roll-out raised adherence by 7.5 points instead of 15, and the adherence-cost relationship carried over, the indirect effect would be and the total saving GBP 50 + GBP 187.50 = GBP 237.50. A health economic model using the trial's total effect would overstate it by GBP 187.50.
8. Interpretation. Most of the saving runs through adherence, and the split between routes is sensitive to plausible confounding, while the total effect is not.
Where mediation evidence enters economic evaluation and HTA
Health technology assessment (HTA) decisions mostly rest on total effects, which randomisation identifies, so mediation analysis usually plays a supporting part. It can explain why costs differ in a trial-based cost-effectiveness analysis and whether the effect depends on a component that may not survive scale-up. Medical Research Council guidance on process evaluation of complex interventions recommends integrating quantitative process data into outcome datasets to test hypothesised mediators.
Surrogates are the clearest HTA case. Technical Support Document 20 from the NICE Decision Support Unit notes that Prentice's criteria require a surrogate endpoint to fully mediate the treatment effect on the final outcome, and that satisfying them does not guarantee a causal relationship between the treatment effects on the surrogate and the final outcome.
Hernán and Robins set out when a natural effect answers a policy question. In a smoking trial with continued smoking as treatment 1 and quitting as 0, if nicotine affected heart disease only through hypertension, and other cigarette components did not affect hypertension, the risk after a switch to nicotine-free cigarettes would equal , estimable from existing trial data, but only with outside evidence for both conditions and no unmeasured common cause of hypertension and heart disease, a claim a later trial with a nicotine-free arm could refute.
The AGReMA reporting guideline, with a 25-item checklist and a 9-item short form, asks for a graph of the assumed causal model with possible confounders and for sensitivity analyses of the no unmeasured confounding assumption, such as a mediational E-value.
Mediators, moderators, confounders and surrogates
Baron and Kenny wrote partly to warn against using the terms moderator and mediator interchangeably. A mediator is caused by treatment and in turn affects the outcome. A moderator changes the size or direction of the treatment effect and is studied through an interaction effect or subgroup analysis, and under the MacArthur criteria summarised by Valeri and VanderWeele a variable that precedes treatment, is not associated with it and interacts with it is a moderator. A confounder is a common cause of treatment and outcome that must be adjusted for, whereas adjusting for a mediator removes the part of the effect it carries. A surrogate endpoint is a mediator asked to stand in for the final outcome.
Common misreadings and limits
Results are often reported with more confidence than their assumptions allow. Four errors recur.
- Reading the proportion mediated as stable. Valeri and VanderWeele cite warnings that it is unstable when the treatment-outcome association is weak, and as a ratio it exceeds 100% or turns negative when direct and indirect effects have opposite signs.
- Ignoring interaction. Wrongly assuming can give invalid inferences, as step 4 shows.
- Overlooking measurement. AGReMA lists measurement error, selection bias, missing data and model misspecification among the limitations to discuss.
- Skipping sensitivity analysis. Imai, Keele and Tingley, and VanderWeele, give methods for judging how far a violation of the no-confounding assumption could change the conclusion.
Sources
- Baron RM, Kenny DA. The moderator-mediator variable distinction in social psychological research: conceptual, strategic, and statistical considerations. Journal of Personality and Social Psychology. 1986;51(6):1173-1182. https://doi.org/10.1037/0022-3514.51.6.1173
- Bujkiewicz S, Achana F, Papanikos T, Riley RD, Abrams KR. NICE DSU Technical Support Document 20: multivariate meta-analysis of summary data for combining treatment effects on correlated outcomes and evaluating surrogate endpoints. Version 2. Decision Support Unit; 2019. https://www.sheffield.ac.uk/nice-dsu/tsds/multivariate-meta-analysis
- Hernán MA, Robins JM. Causal Inference: What If. Boca Raton: Chapman & Hall/CRC; 2020. Online edition of 19 August 2026, Technical Point 22.1 and chapter 23. https://miguelhernan.org/whatifbook
- Imai K, Keele L, Tingley D. A general approach to causal mediation analysis. Psychological Methods. 2010;15(4):309-334. https://doi.org/10.1037/a0020761
- Lee H, Cashin AG, Lamb SE, et al. A guideline for reporting mediation analyses of randomized trials and observational studies: the AGReMA statement. JAMA. 2021;326(11):1045-1056. https://doi.org/10.1001/jama.2021.14075
- MacKinnon DP, Lockwood CM, Hoffman JM, West SG, Sheets V. A comparison of methods to test mediation and other intervening variable effects. Psychological Methods. 2002;7(1):83-104. https://doi.org/10.1037/1082-989x.7.1.83
- Moore GF, Audrey S, Barker M, et al. Process evaluation of complex interventions: Medical Research Council guidance. BMJ. 2015;350:h1258. https://doi.org/10.1136/bmj.h1258
- Valeri L, VanderWeele TJ. Mediation analysis allowing for exposure-mediator interactions and causal interpretation: theoretical assumptions and implementation with SAS and SPSS macros. Psychological Methods. 2013;18(2):137-150. https://doi.org/10.1037/a0031034
- VanderWeele TJ. Bias formulas for sensitivity analysis for direct and indirect effects. Epidemiology. 2010;21(4):540-551. https://doi.org/10.1097/EDE.0b013e3181df191c
Related Concepts (2)
Library
Publications
1
Bayesian Methods in Health Economics — Gianluca Baio, 1st Edition ed., 2012 (Chapman & Hall / CRC Press)
An overview of Bayesian statistical methods for the analysis of health economic data, covering economic evaluation concepts, statistical cost-effectiveness analysis, Bayesian computation and MCMC, and applied health economic evaluation.
BookView source →
Frequently Asked Questions (6)
What is mediation analysis?
Mediation analysis is a statistical method that splits a treatment's effect on health or costs into a direct effect and an indirect effect via a mediator.
Source: Valeri & VanderWeele 2013
What pathway does mediation analysis try to uncover?
The pathway of interest runs from a treatment to an intermediate variable, the mediator, and on from the mediator to the outcome. In health economics the mediator is often a behaviour such as medication adherence or a clinical marker such as blood pressure, while the outcome may be a cost or a final clinical event. Mediation analysis separates the part of the treatment effect that travels along this route from the part that arrives by other routes. Valeri and VanderWeele show how the size of each part can be estimated from one regression model for the mediator and another for the outcome.
Source: Valeri & VanderWeele 2013
How does mediation analysis work?
The traditional product method fits two regressions, one for the mediator given treatment and one for the outcome given treatment and the mediator. The indirect effect is the treatment coefficient in the mediator model multiplied by the mediator coefficient in the outcome model, and the direct effect is the treatment coefficient in the outcome model. The difference method instead takes the indirect effect as the fall in the treatment coefficient once the mediator is added, which gives the same answer for ordinary least squares with continuous outcomes but not with logistic regression. Valeri and VanderWeele extend the formulas to allow an exposure by mediator interaction.
Source: Valeri & VanderWeele 2013
What are direct and indirect effects in mediation?
The direct effect is the part of a treatment's effect on the outcome that does not pass through the mediator, and the indirect effect is the part that does. In the counterfactual framework the natural direct effect compares treatment with no treatment while each person's mediator is held at its untreated value, and the natural indirect effect moves the mediator to its treated value with treatment held fixed. Hernán and Robins record that Robins and Greenland introduced these quantities in 1992 as the pure direct and total indirect effects. The controlled direct effect instead fixes the mediator at one chosen level for everyone and could in principle be checked by randomising both treatment and mediator.
Source: Hernán & Robins 2020
What are the assumptions of mediation analysis?
For a causal reading, Valeri and VanderWeele require no unmeasured confounding of treatment and outcome, of mediator and outcome, and of treatment and mediator, and no mediator-outcome confounder that is itself affected by treatment. The controlled direct effect needs only the first two conditions, while the natural direct and indirect effects need all four. Randomising treatment rules out treatment-outcome and treatment-mediator confounding but leaves the mediator unrandomised, so more adherent patients may differ in ways that also drive costs. The conditions imply that treatment precedes the mediator and the mediator precedes the outcome, and the regression models must be correctly specified.
Source: Valeri & VanderWeele 2013
Why is mediation analysis useful?
Knowing how much of an intervention's effect runs through a proposed mechanism matters when that mechanism may behave differently outside a trial. In a trial-based cost-effectiveness analysis, mediation analysis can explain why costs differ between arms and whether a saving depends on a component, such as better adherence, that may not survive scale-up. Medical Research Council guidance on process evaluation of complex interventions recommends integrating quantitative process data into outcome datasets to test hypothesised mediators. Health technology assessment decisions still rest mostly on total effects, which randomisation identifies, so mediation evidence usually plays a supporting part.
Source: Moore et al. 2015
Trust Record
Verified by Dr Darrin Baines
British health economist
Professional identity: darrinbaines.org
Verification date: 27 Oct 2026
Content version: 1.0.1
Canonical Identity
- Persistent URI
- https://healtheconomics.wiki/concept/mediation-analysis
- Term code
- HE-ES-SA-116
Stable URI · Machine-readable · Resolvable · CC BY 4.0
