Techniqueadvanced
Mediation analysis
Also called natural direct and indirect effects, causal mediation analysis.
Splits a total effect into the part that goes through a mediator and the part that does not, defined by nested counterfactuals and identified under strong assumptions.
Mediation analysis asks how a treatment has its effect on an outcome : how much of the effect goes through an intermediate variable , the mediator, and how much goes by other paths. A training program may raise wages partly because it raises skills and partly because the certificate signals something to employers. The natural indirect effect is the change in when the mediator is moved from the value it would have without treatment to the value it would have with treatment, holding the treatment fixed. The natural direct effect is the change in when the treatment changes but the mediator is held at its untreated value. Both are defined by nested potential outcomes such as , which no unit can ever show, since it combines the treated world for with the untreated world for . They add up to the total effect. They can be estimated by the mediation formula, but only under sequential ignorability, which includes an assumption that no experiment can check. In linear models without interaction the indirect effect is the product of two regression coefficients, and that product equals the difference between the total and the direct coefficient exactly.
In plain words
A drug lowers heart attacks. Part of the reason is that it lowers cholesterol, and part may be something else, like lower inflammation. To split the effect, imagine giving each patient the drug but somehow keeping their cholesterol where it would have been without the drug. The change from no drug to this strange situation is the direct effect. The change from this situation to the plain drug, which lets cholesterol fall, is the indirect effect. The two pieces add to the whole effect.
The strange situation is never observed, not even in an ideal experiment, because a patient's cholesterol without the drug and their outcome with the drug come from two different worlds. So the split needs assumptions that are stronger than for the total effect.
When it applies
A binary treatment , a mediator that occurs after and before , an outcome , and pre-treatment covariates . The potential mediator is and the potential outcome is ; consistency says and . The effects are, for the average over the population:
- Total effect. , the usual average treatment effect.
- Controlled direct effect. , the effect of when is set to for everyone.
- Natural direct effect. .
- Natural indirect effect. .
Adding the last two, the middle terms cancel: . The other order of the telescoping sum, , gives a second split, and the two differ when and interact.
Identification. Sequential ignorability (Imai, Keele and Yamamoto 2010) assumes, for all :
- is independent of given : no unmeasured confounding of the treatment, as in ignorability;
- is independent of given and : no unmeasured confounding of the mediator and the outcome, including the case ;
and positivity, where needed. Then the mediation formula of Pearl (2001) holds:
with integrals in place of sums for continuous variables.
Proof. Fix and condition on throughout. Then . For the second factor, assumption 1 gives . For the first factor,
and the last term is by consistency. The first step uses the joint independence in 1, the second uses 2 with , the third uses 1, and the fourth uses 2 with . Averaging over gives the formula.
The second step, with , is the cross-world part: it relates to , two quantities that never coexist. Robins and Richardson (2010) point out that no experiment, even one that randomizes both and , can test it, so the natural effects are identified only under an assumption that is not testable in principle. The controlled direct effect needs only the same-world parts and is identified by . The method does not apply when a variable affected by confounds and , since then assumption 2 fails for every choice of that excludes it, and the natural effects are not identified at all without further assumptions.
The template
Estimation. The plug-in version of the mediation formula:
MEDIATION(data, X)- 1
fit an outcome model μ(a, m, x) for E[Y | A = a, M = m, X = x] - 2
fit a mediator model p(m | a, x) for Pr[M = m | A = a, X = x] - 3
θ(a, a*) ← (1/n) Σᵢ Σ_m μ(a, m, Xᵢ) p(m | a*, Xᵢ) ▷ for (a, a*) in {(0, 0), (1, 0), (1, 1)} - 4
NDE ← θ(1, 0) - θ(0, 0); NIE ← θ(1, 1) - θ(1, 0) - 5
return (NDE, NIE), with intervals from the bootstrap or the delta method
For a continuous mediator, line L3 integrates over the fitted density of , usually by drawing mediator values from it, as in the algorithm of Imai, Keele and Tingley (2010). For OLS models it has a closed form.
Linear models. Suppose and . Plugging these into the mediation formula (VanderWeele and Vansteelandt 2009), with the mean mediator without treatment:
Without interaction, , these are the classical and , the product of coefficients of Baron and Kenny (1986).
Product equals difference, exactly. Let be the OLS coefficient of in the regression of on , that of on , and those of on . Then in every sample
Proof. Write the long regression as , where the residuals are orthogonal to , and . Take the sample covariance of both sides with : . Divide by : the left side is and .
With the same covariates in all three regressions the identity still holds, by the Frisch-Waugh-Lovell theorem applied after removing from , and . It is an algebraic fact, not a causal one: it holds for any variable , mediator or not. It fails for logistic and other nonlinear models, where the two methods give different answers.
Worked example. No covariates, binary and , and a population with
| 0.2 | 1 | 3 | |
| 0.6 | 2 | 5 |
With randomized and sequential ignorability, the mediation formula gives
- ,
- ,
- ,
so , and . The linear formulas agree: the saturated outcome regression has , , , , and the mediator regression has , , so and . The other split uses : direct effect and indirect effect , again summing to 2.4. The difference comes from the interaction . The controlled direct effects are and .
Classic examples
- Psychology. Baron and Kenny (1986) set the practice of testing whether affects , whether affects given , and whether the effect of shrinks when is added. Their paper is among the most cited in the field; the causal assumptions behind it were made explicit only later.
- Epidemiology. How much of the effect of smoking on low birth weight goes through gestational age, or how much of the effect of education on health goes through income. Robins and Greenland (1992) gave the counterfactual definitions in this setting.
- Genetics. How much of the effect of a variant on disease goes through a measured gene expression or a biomarker.
- Policy. How much of the effect of a job training program on earnings goes through employment and how much through hourly wages.
- Fairness. Path-specific effects, a generalization, ask how much of the effect of a protected attribute on a decision goes through permitted and forbidden paths.
Variations
- Interventional effects. Replace by a random draw from the distribution of . The effects then need no cross-world assumption, and they are identified even with a treatment-induced confounder of and , but they no longer add up to the total effect in general.
- Several mediators. Joint natural effects through a set of mediators are identified like one; splitting between correlated mediators needs more assumptions or path-specific effects.
- Sensitivity analysis. Imai, Keele and Tingley (2010) index violations of assumption 2 by the correlation between the error terms of the mediator and outcome models and report the at which the indirect effect would vanish, in the spirit of Rosenbaum's sensitivity analysis.
- Weighting and doubly robust estimators. Inverse probability weighting by the mediator model, and estimators that combine weighting with the outcome model so that one correct model suffices.
- Front-door adjustment. If carries the whole effect and the treatment-outcome confounding does not touch , the total effect is identified through even with unmeasured confounding of and . This is the front-door criterion of Pearl, listed under see also.
- Principal stratification. For effects within strata of , as with compliers in the local average treatment effect theorem.
Pitfalls
- Assuming the mediator is randomized because the treatment is. Randomizing gives assumption 1 for free but says nothing about assumption 2. A confounder of and biases both natural effects, even in a perfect trial.
- Adjusting for variables affected by the treatment. Putting a post-treatment variable in breaks assumption 1; if it confounds and , the natural effects are not identified.
- Using the Baron-Kenny steps as a causal test. Requiring a significant total effect before looking for mediation has low power and is not needed; a significant product of coefficients is not evidence of a causal path unless the assumptions hold.
- Ignoring the interaction. With interaction, is a controlled direct effect at , not the natural direct effect, and is not the indirect effect.
- Nonlinear models and the difference method. In logistic regression, the change in the coefficient of when is added mixes mediation with the noncollapsibility of the odds ratio.
- Measurement error in . In linear models, classical error in biases the indirect effect toward 0 and the direct effect away from it.
- Reading the proportion mediated as a fraction of people. can be above 1 or negative when the two effects have opposite signs.
Exercises
- Show that , and that the second split, with as the direct part, also sums to .
- In the worked example, compute and from the linear formulas with replaced by and by alone, and say which split these numbers give.
- Show that if and there are no covariates, the plug-in NIE is and that it equals .
- A trial randomizes both and (for example, a drug and a dose of a cholesterol-lowering agent). Which effects does it identify without further assumptions?
- Give an example where and have opposite signs, and explain why the proportion mediated is then misleading.
References
- Reuben M. Baron and David A. Kenny, The moderator-mediator variable distinction in social psychological research, conceptual, strategic, and statistical considerations, Journal of Personality and Social Psychology 51(6), 1986, pp. 1173 to 1182 (the regression steps for mediation and the product of coefficients)
- James M. Robins and Sander Greenland, Identifiability and exchangeability for direct and indirect effects, Epidemiology 3(2), 1992, pp. 143 to 155 (the nested counterfactual definitions of direct and indirect effects and their identification problems)
- Judea Pearl, Direct and indirect effects, Proceedings of the Seventeenth Conference on Uncertainty in Artificial Intelligence, 2001, pp. 411 to 420 (natural direct and indirect effects and the mediation formula)
- Kosuke Imai, Luke Keele and Dustin Tingley, A general approach to causal mediation analysis, Psychological Methods 15(4), 2010, pp. 309 to 334 (sequential ignorability, the estimation algorithm by simulation, sensitivity analysis)
- Kosuke Imai, Luke Keele and Teppei Yamamoto, Identification, inference and sensitivity analysis for causal mediation effects, Statistical Science 25(1), 2010, pp. 51 to 71 (the identification theorem under sequential ignorability and the sensitivity parameter)
- James M. Robins and Thomas S. Richardson, Alternative graphical causal models and the identification of direct effects, in Causality and Psychopathology, Oxford University Press, 2010, the whole chapter (cross-world independence, why no experiment identifies natural effects; general locator, the page numbers were not checked)
- Tyler J. VanderWeele and Stijn Vansteelandt, Conceptual issues concerning mediation, interventions and composition, Statistics and Its Interface 2(4), 2009, pp. 457 to 468 (the regression formulas for natural effects with an exposure-mediator interaction)
- Tyler J. VanderWeele, Explanation in Causal Inference, Methods for Mediation and Interaction, Oxford University Press, 2015, Chapters 2 and 3 on mediation with regression and on sensitivity analysis (general locator, the section numbers were not checked)
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W3 standard |
|
Tag EGAEMH Edit this page History Report an error Markdown