Why Treatment–Mediator Interaction Changes the Decomposition
A treatment may change an outcome directly and may also change a mediator that affects the outcome. When the treatment modifies the mediator’s outcome association, the mediated contribution is not a single fixed slope times the mediator change: it depends on the treatment value at which that association is evaluated. The same feature also makes the direct effect depend on the mediator value held fixed.
This tutorial derives those dependencies for a binary treatment and a linear conditional mean model. The focus is on the natural direct and indirect effects and their additive decompositions. The key point is not that one decomposition is universally preferable, but that each component must be reported with its reference treatment specified.
There are two standard ways to decompose the total natural effect \(E[Y(1,M(1))-Y(0,M(0))]\). One changes treatment while holding the mediator at its value under control, then changes the mediator under treatment. The other changes the mediator while holding treatment at control, then changes treatment with the mediator at its treated value. Both are additive decompositions, but they evaluate the components at different reference values.
Model and Derivation
Suppose the outcome conditional mean follows a linear model with a treatment–mediator product term:
Here \(C\) denotes baseline covariates, \(\gamma(c)\) allows a covariate-specific contribution to the conditional mean, and the displayed coefficients are assumed not to vary across covariate strata. For a derivation without covariate standardization, take \(C\) to be absent. The interaction means the mediator slope at treatment \(a\) is \(\beta_M+\beta_{AM}a\); the direct treatment contrast at fixed mediator value \(m\) is \(\beta_A+\beta_{AM}m\).
Let \(\mu_a(c)=E[M\mid A=a,C=c]\), and average over the target population distribution of \(C\). Under the assumptions needed to identify natural effects, the mediation formula is
This formula uses the outcome regression at treatment \(a\), averaged over the mediator distribution under \(a^*\), within covariate strata and then standardized over \(C\). For this linear conditional mean, the integral depends on the mediator distribution only through its mean. Substituting the model gives
Subtracting two such means gives the effects. Write \(\bar{\mu}_a=E_C[\mu_a(C)]\), the target-population standardized mediator mean under treatment \(a\). The direct effect with the mediator at its control value and the indirect effect evaluated at treatment are
The alternative components, using the treated mediator value for the direct effect and control treatment for the indirect effect, are
These formulas show exactly where the interaction enters. The direct effect changes with the mediator reference mean, while the indirect effect changes with the treatment reference value. Both decompositions sum to the same total natural effect:
The causal interpretation of these quantities requires more than a well-fitting regression. The natural effects must be identified under appropriate consistency, positivity, and exchangeability conditions for treatment and mediator–outcome relations, including the required conditions for the nested counterfactuals. If those identification assumptions or the specified conditional mean model fail, the formulas do not by themselves establish causal effects.
Worked Calculations
Worked Example: Direct and Indirect Effects at Two References
Consider a hypothetical study with a continuous mediator measured in symptom-score points and an outcome measured in quality-of-life points. Assume the identification conditions hold, and suppose the fitted conditional means are \(E[M\mid A=0]=5\), \(E[M\mid A=1]=7\), and \(E[Y\mid A,M]=10+1.5A+3M+0.8AM\). Calculate both decompositions for treatment 1 versus 0.
The mediator mean change is \(7-5=2\) symptom-score points. The direct effect holding the mediator at its control mean is
quality-of-life points. The indirect effect evaluated at treatment 1 is
quality-of-life points. Their sum is \(5.5+7.6=13.1\) points. Under the alternative reference, the direct effect is \(1.5+0.8(7)=7.1\) points, and the indirect effect is \(3(7-5)=6.0\) points. These also sum to \(13.1\) points.
As a check, the total effect from the marginal outcome means is \(\beta_A+\beta_M(7-5)+\beta_{AM}(7)=1.5+3(2)+0.8(7)=13.1\) points. The direct and indirect components differ across decompositions because the interaction is nonzero, not because the total changed.
Worked Example: Opposing Direct and Mediated Contributions
In another hypothetical setting, let the mediator be a biomarker in concentration units and the outcome be a clinical score in points. Assume identification conditions hold, with \(\bar{\mu}_0=4\), \(\bar{\mu}_1=6\), and conditional outcome mean \(E[Y\mid A,M]=20-2A+1.2M-0.5AM\). Find the effects and check their sum.
Here the mediator increases by \(6-4=2\) concentration units. Holding the mediator at its control value gives
outcome points. At treatment 1, the mediator slope is \(\beta_M+\beta_{AM}=1.2-0.5=0.7\) outcome points per concentration unit. Therefore,
outcome points, and the total is \(-4.0+1.4=-2.6\) points. With the other reference, \(\text{NDE}_{M(1)}=-2+(-0.5)(6)=-5.0\) points and \(\text{NIE}_{A=0}=1.2(2)=2.4\) points. The sum is again \(-5.0+2.4=-2.6\) points. A positive indirect effect here offsets part of the negative direct effect; it does not imply that the total effect is positive.
Worked Example: Standardizing Across Baseline Strata
Suppose a hypothetical target population has two equally common baseline strata. In stratum 1 the mediator means under control and treatment are 2 and 3 units; in stratum 2 they are 6 and 8 units. Assume the same outcome model in both strata, \(E[Y\mid A,M,C]=\gamma(C)+2A+1M+0.4AM\), and that identification conditions hold. Calculate effects standardized to this population.
The standardized control mediator mean is \(\bar{\mu}_0=(2+6)/2=4\) units. The treated mean is \(\bar{\mu}_1=(3+8)/2=5.5\) units, so the standardized change is \(1.5\) units. The direct effect with the mediator at its control value is
outcome units. The indirect effect evaluated at treatment is
outcome units, giving a total of \(3.6+2.1=5.7\) units. For the alternative decomposition, \(\text{NDE}_{M(1)}=2+0.4(5.5)=4.2\) units and \(\text{NIE}_{A=0}=1(1.5)=1.5\) units; their sum is also \(5.7\). The calculations use the target population’s stratum proportions, rather than treating either stratum’s mediator means as the overall means.
Why the Reference Must Be Reported
When \(\beta_{AM}=0\), the mediator slope does not vary with treatment and the direct contrast does not vary with the mediator. Consequently, these two additive decompositions give the same direct effect and the same indirect effect. When \(\beta_{AM}\ne 0\), the decomposition is reference-dependent. The two direct effects differ by \(\beta_{AM}(\bar{\mu}_1-\bar{\mu}_0)\), and the two indirect effects differ by the same amount in the opposite direction. Their sum therefore stays fixed.
This is a scale-specific additive result for the stated linear conditional mean model. It does not mean natural effects are generally reference-invariant, nor does it make the components interchangeable without explanation. Report whether the direct effect holds the mediator at its control or treated value, and whether the indirect effect is evaluated at control or treatment.
A related units check catches a frequent coefficient error. Because treatment is dimensionless and \(A M\) has mediator units, both \(\beta_M M\) and \(\beta_{AM} A M\) must have outcome units. Thus \(\beta_M\) and \(\beta_{AM}\) are each measured in outcome units per mediator unit; \(\beta_A\) is measured in outcome units.
Check Your Understanding
Use the definitions and formulas above to answer these questions.
- In the linear model, what is the mediator slope at treatment 0, and what is it at treatment 1?
- For treatment 1 versus 0, write the natural direct effect that holds the mediator at its control value.
- If the treatment–mediator interaction coefficient is zero, what happens to the two direct-effect references and the two indirect-effect references?
- Suppose \(\beta_{AM}=0.3\) outcome units per mediator unit and the standardized mediator mean increases by 4 units. By how much do the two direct effects differ?
- Why does a nonzero interaction change the components of the additive decomposition without changing the total natural effect?