Tutorials › Causal Inference › Treatment-Mediator Interaction in Natural Effects

Mediation and Path-Specific Effects · Tutorial 787 of 972

Treatment-Mediator Interaction in Natural Effects

Learn to derive and calculate natural direct and indirect effects with treatment–mediator interaction, and interpret why their magnitudes depend on the reference treatment value.

Advanced 11 min read

What You'll Learn

  • State the two natural-effect decompositions for a binary treatment.
  • Derive direct and indirect effects from a linear outcome model with an interaction term.
  • Identify which treatment value serves as the reference for each effect.
  • Calculate effects using mediator means and interpret the results in context.
  • Check that alternative decompositions sum to the same total effect.
  • Recognize when an interaction coefficient is measured in outcome units per mediator unit.

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.

Definition: Let \(A\in\{0,1\}\) denote treatment, \(M(a)\) the mediator value that would occur under treatment \(a\), and \(Y(a,m)\) the outcome that would occur under treatment \(a\) if the mediator were set to \(m\). The natural direct effect evaluated with the mediator at its value under \(a^*\) is \(E[Y(1,M(a^*))-Y(0,M(a^*))]\). The natural indirect effect evaluated at treatment \(a\) is \(E[Y(a,M(1))-Y(a,M(0))]\). These definitions compare counterfactual outcomes in the same target population.

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.

$$ \begin{aligned} E[Y(1,M(1))-Y(0,M(0))] &=E[Y(1,M(0))-Y(0,M(0))]\\ &\quad+E[Y(1,M(1))-Y(1,M(0))]\\ &=E[Y(1,M(1))-Y(0,M(1))]\\ &\quad+E[Y(0,M(1))-Y(0,M(0))]. \end{aligned} $$

Model and Derivation

Suppose the outcome conditional mean follows a linear model with a treatment–mediator product term:

$$ E[Y\mid A=a,M=m,C=c] =\beta_0+\gamma(c)+\beta_A a+\beta_M m+\beta_{AM}am. $$

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

$$ E[Y(a,M(a^*))] = E_C\left[ \int E[Y\mid A=a,M=m,C]\, f(m\mid A=a^*,C)\,dm \right]. $$

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

$$ E[Y(a,M(a^*))] = E_C\!\left[ \beta_0+\gamma(C)+\beta_A a+ (\beta_M+\beta_{AM}a)\mu_{a^*}(C) \right]. $$

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

$$ \begin{aligned} \text{NDE}_{M(0)} &=E[Y(1,M(0))-Y(0,M(0))] =\beta_A+\beta_{AM}\bar{\mu}_0,\\ \text{NIE}_{A=1} &=E[Y(1,M(1))-Y(1,M(0))] =(\beta_M+\beta_{AM})(\bar{\mu}_1-\bar{\mu}_0). \end{aligned} $$

The alternative components, using the treated mediator value for the direct effect and control treatment for the indirect effect, are

$$ \begin{aligned} \text{NDE}_{M(1)} &=E[Y(1,M(1))-Y(0,M(1))] =\beta_A+\beta_{AM}\bar{\mu}_1,\\ \text{NIE}_{A=0} &=E[Y(0,M(1))-Y(0,M(0))] =\beta_M(\bar{\mu}_1-\bar{\mu}_0). \end{aligned} $$

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:

$$ \begin{aligned} \text{Total effect} &=\beta_A+\beta_M(\bar{\mu}_1-\bar{\mu}_0) +\beta_{AM}\bar{\mu}_1\\ &=\text{NDE}_{M(0)}+\text{NIE}_{A=1}\\ &=\text{NDE}_{M(1)}+\text{NIE}_{A=0}. \end{aligned} $$
Interpretation: With treatment coded as dimensionless 0/1, \(\beta_A\) has outcome units, while \(\beta_M\) and \(\beta_{AM}\) have outcome units per mediator unit. The interaction coefficient multiplies \(A M\), so it must have the same units as the mediator slope. The natural effects have outcome units.

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

$$ \text{NDE}_{M(0)} =\beta_A+\beta_{AM}\bar{\mu}_0 =1.5+0.8(5)=5.5 $$

quality-of-life points. The indirect effect evaluated at treatment 1 is

$$ \text{NIE}_{A=1} =(\beta_M+\beta_{AM})(\bar{\mu}_1-\bar{\mu}_0) =(3+0.8)(7-5)=7.6 $$

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

$$ \text{NDE}_{M(0)} =-2+(-0.5)(4)=-4.0 $$

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,

$$ \text{NIE}_{A=1}=0.7(2)=1.4 $$

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

$$ \text{NDE}_{M(0)} =2+0.4(4)=3.6 $$

outcome units. The indirect effect evaluated at treatment is

$$ \text{NIE}_{A=1} =(1+0.4)(5.5-4)=1.4(1.5)=2.1 $$

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.

Common mistake: It is incorrect to use \(\beta_A\) as the natural direct effect and \(\beta_M(\bar{\mu}_1-\bar{\mu}_0)\) as the natural indirect effect whenever the outcome model contains an interaction. The correction is to evaluate the direct contrast at the stated mediator reference and the mediator slope at the stated treatment reference. For example, at treatment 1 the mediator slope is \(\beta_M+\beta_{AM}\), not \(\beta_M\).

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.

Key takeaway: Under a linear outcome model with treatment–mediator interaction, natural direct effects depend on the mediator reference, and natural indirect effects depend on the treatment reference. Both valid additive decompositions recover the same total natural effect, provided the effects are identified and the model is appropriate.

Check Your Understanding

Use the definitions and formulas above to answer these questions.

  1. In the linear model, what is the mediator slope at treatment 0, and what is it at treatment 1?
  2. For treatment 1 versus 0, write the natural direct effect that holds the mediator at its control value.
  3. If the treatment–mediator interaction coefficient is zero, what happens to the two direct-effect references and the two indirect-effect references?
  4. 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?
  5. Why does a nonzero interaction change the components of the additive decomposition without changing the total natural effect?
Clinical Biostats