Why Interaction Changes Mediation Effects
In a mediation analysis, the exposure may affect the outcome both directly and through a mediator. A further possibility is that the mediator’s association with the outcome changes across exposure levels. For example, a molecular mediator may have a different effect on a phenotype among people with different levels of an exposure. In that setting, one direct effect or one indirect effect does not generally summarize every relevant contrast.
The key is to specify the exposure contrast and the conditions under which the effects are evaluated. This tutorial defines controlled and natural effects for a continuous outcome, states assumptions needed to identify natural effects, and derives their formulas under linear models that include an exposure–mediator product term. The formulas are on the outcome scale and are conditional on covariates.
Fix a covariate stratum \(C=c\), and compare exposure levels \(a^*\) and \(a\). The conditional natural direct effect (NDE) and natural indirect effect (NIE) used here are
and
The NDE changes exposure while holding the mediator to its value under the reference exposure \(a^*\). The NIE changes the mediator from its value under \(a^*\) to its value under \(a\), while holding exposure at \(a\). Their sum is the conditional total effect:
This identity follows by adding and subtracting \(Y(a,M(a^*))\) inside the total-effect contrast. It is an exact decomposition of that contrast, not a claim that either component is constant across exposure levels.
Identification Requires More Than Fitting Two Regressions
Potential outcomes define causal effects, but observed data do not reveal both \(Y(a,M(a^*))\) and \(Y(a^*,M(a^*))\) for the same person. A mediation formula connects these counterfactual quantities to observed conditional distributions only under assumptions. The conditions below are one sufficient set, stated for the exposure levels of interest.
- Consistency and no interference: observed outcomes and mediators equal their potential values at the observed exposure and mediator levels, and one person’s exposure does not affect another person’s outcome.
- Exposure exchangeability: conditional on \(C\), exposure is independent of the relevant potential mediators and outcomes. This rules out unaccounted confounding of exposure–mediator and exposure–outcome relations.
- Mediator–outcome exchangeability: conditional on exposure and \(C\), the mediator is independent of the relevant potential outcomes. In particular, there is no unmeasured mediator–outcome confounding after conditioning on \(A\) and \(C\), and no exposure-induced mediator–outcome confounder left uncontrolled.
- Cross-world condition: for the relevant \(a\), \(a^*\), and \(m\), \(Y(a,m)\) is independent of \(M(a^*)\) conditional on \(C\). This explicitly links potential outcomes under one exposure level to the mediator under another.
- Positivity: each exposure level being compared has support within the covariate strata of interest, and the mediator values needed for the comparison have support among observations at the outcome exposure level.
The cross-world condition matters because the natural outcome \(Y(a,M(a^*))\) combines potential quantities under different exposure assignments. Observed-data exchangeability statements at a single exposure level do not, by themselves, establish the independence of \(Y(a,m)\) and \(M(a^*)\). The cross-world condition is a substantive assumption, not something verified by fitting an interaction model.
Under the stated assumptions, consistency and exchangeability identify the outcome regression and mediator distribution, while the cross-world condition permits averaging the outcome regression over the mediator distribution under \(a^*\):
To see the role of the cross-world condition, first average \(Y(a,m)\) over the distribution of \(M(a^*)\). Conditional independence makes the mean of \(Y(a,m)\) at each mediator value equal to its mean given \(C=c\); exchangeability and consistency then identify that mean from the observed outcome regression at \(A=a\). Exposure exchangeability and consistency identify the distribution of \(M(a^*)\) from \(f(m\mid A=a^*,C=c)\). Without the cross-world condition, the joint dependence between \(Y(a,m)\) and \(M(a^*)\) could change this average.
In genetic mediation, an instrumental-variable design may help address some exposure-related confounding under its own validity assumptions. It does not automatically establish the mediator–outcome or cross-world conditions above. Causal interpretation still depends on the assumptions needed for the particular mediated effects.
Linear Models With an Interaction
Consider a continuous exposure, mediator, and outcome. Suppose the conditional mediator mean and outcome mean are modeled as
and
These are conditional-mean models. The interaction coefficient \(\beta_{AM}\) describes how the outcome-mean slope for the mediator changes with exposure: at exposure \(a\), a one-unit increase in \(m\) changes the fitted conditional mean by \(\beta_M+\beta_{AM}a\) outcome units, holding \(C\) fixed. Conversely, the exposure slope at mediator value \(m\) is \(\beta_A+\beta_{AM}m\). The interpretation assumes the specified linear forms are adequate over the exposure and mediator ranges being used.
Let \(\mu_M(a,c)=E\{M(a)\mid C=c\}\). Under the mediator model, \(\mu_M(a,c)=\alpha_0+\alpha_Aa+\alpha_C^Tc\). Applying the mediation formula gives the natural effects:
The direct effect depends on the mediator mean under the reference exposure. The indirect effect depends on the exposure level at which the mediator’s effect on the outcome is evaluated. Both can therefore vary with the chosen contrast, and the indirect effect can vary with the outcome exposure level even when the mediator contrast is unchanged.
A controlled direct effect fixes the mediator to a particular value \(m\), rather than to a counterfactual mediator value:
It answers a different question from the NDE. The CDE is evaluated at a specified mediator value; the NDE averages over the mediator distribution under the reference exposure. With interaction, neither is generally represented by \(\beta_A\) alone.
Worked Example: Natural Effects for a Two-Unit Exposure Contrast
Suppose a hypothetical analysis, within a fixed covariate stratum, gives \(\mu_M(a,c)=1+0.5a\) mediator units. Its outcome-mean model has \(\beta_A=0.4\) outcome units per exposure unit, \(\beta_M=0.8\) outcome units per mediator unit, and \(\beta_{AM}=0.3\) outcome units per exposure–mediator unit. Compare \(a^*=0\) with \(a=2\). Assume the identification conditions and linear mean models above are appropriate.
The mediator means are \(\mu_M(0,c)=1\) and \(\mu_M(2,c)=1+0.5(2)=2\). The exposure contrast is \(2-0=2\) units. Therefore,
The conditional total effect is \(1.4+1.4=2.8\) outcome units. This decomposition applies to this specified two-unit contrast and covariate stratum; it does not imply that either component is constant at other exposure levels.
Worked Example: A Controlled Direct Effect Changes With the Mediator
In a second hypothetical model, let \(\beta_A=0.25\) outcome units per exposure unit and \(\beta_{AM}=-0.10\) outcome units per exposure–mediator unit. Compare exposure \(a^*=1\) with \(a=3\), a two-unit contrast. Calculate the controlled direct effect at mediator values \(m=2\) and \(m=5\). Suppose both mediator values are within the relevant support.
At \(m=2\), the exposure slope is \(0.25-0.10(2)=0.05\) outcome units per exposure unit. Hence
At \(m=5\), the exposure slope is \(0.25-0.10(5)=-0.25\) outcome units per exposure unit, giving
The direct contrast is positive at \(m=2\) and negative at \(m=5\). This is not an arithmetic contradiction: the interaction makes the exposure contrast depend on the mediator value. The fitted exposure slope is zero at \(m=0.25/0.10=2.5\) mediator units.
Reference Choices and a Second Decomposition
The NDE and NIE defined above use one particular ordering: the direct effect is evaluated at the mediator distribution under \(a^*\), and the indirect effect at exposure \(a\). One can instead add and subtract \(Y(a^*,M(a))\). This gives a different, equally exact decomposition of the same total effect:
Here the direct effect uses the mediator mean under \(a\), and the indirect effect uses the exposure level \(a^*\) in the mediator slope. Their sum again equals the total effect. When \(\beta_{AM}=0\), the two decompositions agree in this linear model. When \(\beta_{AM}\ne0\), the components can differ even though the total effect is unchanged. Reporting a mediated effect therefore requires stating the exposure contrast and which natural-effect definitions are being used.
Worked Example: Checking the Decomposition Against the Total Mean Contrast
For a third hypothetical analysis in a fixed covariate stratum, let the mediator mean be \(\mu_M(a,c)=1.8+0.4a\). Let \(\beta_A=0.5\), \(\beta_M=0.7\), and \(\beta_{AM}=0.2\). Compare \(a^*=1\) with \(a=3\). The mediator means are \(1.8+0.4(1)=2.2\) and \(1.8+0.4(3)=3.0\).
For the definitions used first in this tutorial, the natural direct effect and indirect effect are
Their sum is \(1.88+1.04=2.92\) outcome units. Check this against the fitted outcome means, omitting the common intercept and covariate contribution, which cancel in the contrast. At \(A=3\) and mediator mean \(3.0\), the exposure-, mediator-, and interaction-term contributions are \(0.5(3)+0.7(3)+0.2(3)(3)=5.4\). At \(A=1\) and mediator mean \(2.2\), they are \(0.5(1)+0.7(2.2)+0.2(1)(2.2)=2.48\). The total contrast is \(5.4-2.48=2.92\) outcome units, matching the decomposition.
Common Mistakes and Interpretation
- Calling \(\beta_A\) the direct effect. With an interaction, the controlled direct effect is \((a-a^*)(\beta_A+\beta_{AM}m)\). The coefficient \(\beta_A\) is the exposure slope only at \(m=0\), which may not be a meaningful mediator value.
- Using one mediated effect for every exposure contrast. The formulas contain exposure levels and mediator means. State the contrast, covariate stratum, and natural-effect definition when reporting a result.
- Confusing a controlled and natural direct effect. A CDE fixes \(M=m\); an NDE averages over the mediator distribution under a specified exposure. They answer different questions.
- Treating regression adjustment as proof of identification. A product term allows the fitted outcome slope to vary, but does not establish exchangeability, positivity, or the cross-world condition required for natural effects.
- Calling an interaction causal without support. A fitted interaction is a feature of the specified conditional-mean model. Its causal interpretation depends on the identification assumptions, correct model form, and adequate data support.
In genetic mediation, these distinctions are useful because a genetic or molecular exposure may have different outcome consequences at different mediator levels. Interaction also makes summaries such as a single “proportion mediated” harder to interpret: the direct and indirect components can depend on the chosen contrast and reference. For a continuous outcome under the stated linear model, the formulas provide effects in outcome units, conditional on \(C=c\); they should not be transferred automatically to a different outcome scale or model.
Check Your Understanding
Answer each question using the definitions and assumptions in this tutorial.
- In the NDE defined here, under which exposure level is the mediator held, and under which exposure level is it held for the NIE?
- Why is the cross-world condition relevant to identifying \(E\{Y(a,M(a^*))\mid C=c\}\)?
- For the outcome model in this tutorial, write the controlled direct effect at mediator value \(m\) for an exposure contrast from \(a^*\) to \(a\).
- How does the formula for the NIE depend on the exposure level when \(\beta_{AM}\ne0\)?
- Why can two valid decompositions of the same total effect produce different direct and indirect components?