Tutorials › Propensity Score Matching and Instrumental Variables › Why Adjusting for Mediators Changes the Causal Question

Randomization Versus Observational Data · Tutorial 37 of 699

Why Adjusting for Mediators Changes the Causal Question

Learn why controlling for a mediator changes the effect being estimated, and when a mediator-adjusted regression coefficient does not represent a causal direct effect.

Beginner 12 min read

What You'll Learn

  • Define total, controlled direct, natural direct, and natural indirect effects using potential outcomes.
  • Derive the total effect in a simple additive treatment–mediator–outcome model.
  • Distinguish a structural treatment effect from the coefficient in a regression that includes the mediator.
  • Identify assumptions needed to interpret mediator-adjusted comparisons causally.
  • Recognize when adjustment blocks a pathway or yields a misleading coefficient.
  • Choose whether to adjust for a mediator according to the causal question.

Why a Mediator Changes the Question

A treatment can affect an outcome through more than one route. It may have an effect that does not operate through a particular intermediate variable, and it may also change that intermediate variable, which in turn changes the outcome. That intermediate variable is called a mediator. For example, a program may affect blood pressure partly by changing exercise habits. If the goal is the program’s overall effect, comparing people at the same observed exercise level is not the same question as comparing their outcomes under the program versus no program.

The central distinction is between the total treatment effect, which includes all pathways from treatment to outcome, and effects defined while holding the mediator fixed or changing it between treatment conditions. Adjusting for a mediator in a regression can block some of the treatment pathway. It can also produce a coefficient that does not equal the causal effect one intended to estimate.

Definition: Let \(A\) be a binary treatment, \(M\) a post-treatment mediator, and \(Y\) an outcome. Let \(M(a)\) denote the mediator value that would occur under treatment \(a\), and let \(Y(a,m)\) denote the outcome that would occur if treatment were set to \(a\) and the mediator were set to \(m\). The observed mediator and outcome satisfy \(M=M(A)\) and \(Y=Y(A,M(A))\), under consistency.

These potential outcomes define several distinct causal effects. The total effect compares the outcome under treatment with the outcome under no treatment, allowing the mediator to take its corresponding value in each condition:

$$ TE=E\left[Y(1,M(1))-Y(0,M(0))\right]. $$

A controlled direct effect at a specified mediator value \(m\) compares treatment conditions while setting the mediator to that same value in both:

$$ CDE(m)=E\left[Y(1,m)-Y(0,m)\right]. $$

The phrase “direct effect” here means an effect not operating through the mediator as defined; it does not mean that treatment has no other mechanisms. Two further quantities make the pathway distinction explicit. The natural direct effect holds the mediator at the value it would take without treatment, while the natural indirect effect changes the mediator from its untreated to treated value while treatment is held at one:

$$ NDE=E\left[Y(1,M(0))-Y(0,M(0))\right], \qquad NIE=E\left[Y(1,M(1))-Y(1,M(0))\right]. $$

With these definitions, \(TE=NDE+NIE\): add and subtract \(Y(1,M(0))\) inside the total-effect contrast. This is an algebraic decomposition, not by itself a recipe for identifying the effects from observed data. In particular, observing the mediator does not reveal both \(M(0)\) and \(M(1)\) for the same person. Claims about causal mediation therefore require assumptions beyond simply fitting a regression with \(A\) and \(M\).

An Additive Model Shows the Pathways

A simple model makes the pathway arithmetic transparent. Suppose the mediator and outcome potential outcomes follow:

$$ M(a)=\alpha_0+\alpha_1a+U_M, \qquad Y(a,m)=\beta_0+\beta_1a+\beta_2m+U_Y. $$

Here \(\alpha_1\) is the treatment-related change in the mediator in this model, \(\beta_2\) is the mediator’s outcome effect under the model, and \(\beta_1\) is the treatment effect when the mediator is held fixed. The model assumes additive relationships with no treatment-by-mediator interaction. The same underlying \(U_M\) and \(U_Y\) apply to an individual’s potential outcomes across interventions. They may be dependent on each other; the causal contrasts below do not require their independence.

The total effect follows by substituting the mediator potential outcomes into the outcome equation and subtracting:

$$ \begin{aligned} Y(1,M(1))-Y(0,M(0)) &=\beta_1+\beta_2\{M(1)-M(0)\}\\ &=\beta_1+\beta_2\alpha_1. \end{aligned} $$

The first term is the effect when the mediator is fixed; the second is the effect transmitted through the change in the mediator. In this additive model, \(CDE(m)=\beta_1\) for every \(m\), \(NDE=\beta_1\), and \(NIE=\beta_2\alpha_1\). This model-based decomposition is useful for understanding what a total-effect analysis includes. It does not mean that a regression including \(M\) automatically estimates \(\beta_1\).

Worked Example: Separating Direct and Mediated Effects

Suppose a hypothetical program is randomized. Let \(A=1\) indicate the program, \(M\) be weekly exercise hours, and \(Y\) be the reduction in systolic blood pressure, measured in mmHg. Assume the additive model above, with \(\alpha_1=2\) hours per week and \(\beta_1=1\) mmHg and \(\beta_2=1.5\) mmHg per additional weekly exercise hour. Assume the model correctly describes the potential outcomes, with no treatment-by-exercise interaction.

The modeled mediator change is \(M(1)-M(0)=2\) hours per week. The effect through the mediator is therefore:

$$ \beta_2\alpha_1 =1.5\ \text{mmHg per hour}\times 2\ \text{hours per week} =3\ \text{mmHg}. $$

The controlled direct effect is \(\beta_1=1\) mmHg, and the total effect is:

$$ TE=\beta_1+\beta_2\alpha_1 =1+3=4\ \text{mmHg}. $$

Thus the model implies an average total reduction of 4 mmHg under the program compared with no program: 1 mmHg not operating through exercise and 3 mmHg operating through the program-induced exercise change. This conclusion relies on the specified causal model; randomization of \(A\) alone does not establish that the mediator’s outcome relation is unconfounded.

Why a Mediator-Adjusted Regression Is Not Automatically a Direct Effect

A regression of \(Y\) on \(A\) and \(M\) describes outcome differences conditional on the included variables, under its modeling assumptions. Its treatment coefficient is not automatically the controlled direct effect, the natural direct effect, or the structural parameter \(\beta_1\). Conditioning on a mediator compares people who have the same observed mediator value, but those people may differ in why they reached that value. In addition, the adjustment blocks the part of the treatment effect that operates through changes in \(M\), if the analysis succeeds in isolating a direct contrast.

In the additive structural model, the conditional-mean requirement \(E[U_Y\mid A,M]=0\), together with correct linear specification and adequate variation to estimate the coefficients, is a sufficient condition for the regression treatment coefficient to equal \(\beta_1\). Randomization makes treatment independent of pretreatment causes on average; it does not guarantee that \(U_Y\) is unrelated to \(M\) after conditioning on treatment. If mediator and outcome causes are shared, the required conditional-mean assumption can fail.

Worked Example: Randomization Does Not Ensure a Correct Mediator-Adjusted Coefficient

Consider a hypothetical randomized study with the structural equations \(M=A+U_M\) and \(Y=2A+3M+U_Y\), where \(U_Y=U_M\) and \(U_M\) is nondegenerate with mean zero and independent of randomized \(A\). The mediator increases by one unit when treatment changes from 0 to 1, and the outcome model has \(\beta_1=2\) and \(\beta_2=3\).

From the potential-outcome model, holding the mediator fixed gives a controlled direct effect of 2 outcome units. The total effect is:

$$ TE=\beta_1+\beta_2\alpha_1 =2+3(1)=5\ \text{outcome units}. $$

But because \(U_M=M-A\) and \(U_Y=U_M\), the observed outcome can be rewritten exactly as:

$$ \begin{aligned} Y&=2A+3M+U_M\\ &=2A+3M+(M-A)\\ &=A+4M. \end{aligned} $$

A regression of \(Y\) on \(A\) and \(M\) therefore has treatment coefficient 1, not 2. It estimates the exact conditional relationship \(E[Y\mid A,M]=A+4M\), but this coefficient is not the controlled direct effect in the specified structural model. Randomization of treatment holds, yet \(E[U_Y\mid A,M]=M-A\), which is not generally zero. The example shows why neither randomization alone nor the structural equation’s treatment coefficient justifies interpreting the mediator-adjusted regression coefficient as a causal direct effect.

The Direct Effect Can Depend on the Mediator Level

The additive model’s constant direct effect is a simplifying assumption. If treatment and mediator interact in their effects on the outcome, the controlled direct effect can vary with the mediator value. In that case, a single treatment coefficient may obscure which mediator level or population is relevant, even apart from confounding or model misspecification.

Worked Example: A Treatment-by-Mediator Interaction

Suppose, hypothetically, that the mediator values are fixed by treatment at \(M(0)=2\) and \(M(1)=4\), and the outcome potential outcomes are \(Y(a,m)=3a+2m+am\). Assume these equations correctly describe the potential outcomes for the units of interest.

The controlled direct effect at mediator level \(m\) is:

$$ Y(1,m)-Y(0,m) =(3+2m+m)-(2m) =3+m. $$

So the controlled direct effect is 5 outcome units at \(m=2\), but 7 outcome units at \(m=4\). The total effect is calculated using each treatment condition’s mediator value:

$$ \begin{aligned} Y(1,4)-Y(0,2) &=(3+2(4)+1(4))-(2(2))\\ &=15-4\\ &=11\ \text{outcome units}. \end{aligned} $$

For the natural direct effect, hold the mediator at \(M(0)=2\): \(Y(1,2)-Y(0,2)=9-4=5\). For the natural indirect effect under treatment, change the mediator from 2 to 4 while holding treatment at 1: \(Y(1,4)-Y(1,2)=15-9=6\). These sum to \(5+6=11\), the total effect. The example verifies the decomposition while showing that “the direct effect” needs a specified mediator level or definition when the effects interact.

Choosing an Analysis and Checking Its Limits

The right decision depends first on the causal question. If the target is the total effect, adjusting for a mediator is generally inappropriate: it removes part of the pathway that the total effect is meant to include and may introduce additional bias. Adjustment for suitable pretreatment covariates can address baseline differences or improve precision under the relevant assumptions, but a mediator is measured after treatment and is not a baseline covariate.

If the target is a direct or indirect effect, define that effect precisely before choosing a model. A controlled direct effect concerns an intervention that sets the mediator to \(m\); it is not defined merely as the difference between people observed at the same \(M\). Natural direct and indirect effects refer to potential mediator values under different treatment conditions. Their identification from observational mediator and outcome data requires substantive assumptions about treatment assignment, mediator–outcome confounding, and the counterfactual quantities involved. Treatment randomization by itself does not supply all those assumptions.

Useful checks include verifying the time ordering of treatment, mediator, and outcome; stating whether the target is total or direct; considering whether the model allows treatment–mediator interaction; and asking whether measured causes of both mediator and outcome could remain uncontrolled. A conditional regression fit or a balanced treatment comparison cannot, by itself, verify those causal assumptions.

Common mistake: “Treatment was randomized, so the treatment coefficient from a regression adjusted for the mediator must be the direct causal effect.” Randomization supports a treatment comparison before conditioning on post-treatment variables, but it does not ensure the mediator and outcome are unconfounded within treatment groups. The regression coefficient may differ from the controlled direct effect and generally does not represent the total effect. Define the estimand first, then justify the adjustment and its assumptions.

The main alternatives answer different questions. An unadjusted randomized treatment contrast, or one adjusted only for appropriate pretreatment variables, targets the total effect when its design and analysis assumptions hold. A mediator-adjusted regression describes a conditional association unless additional assumptions justify a causal interpretation. A mediation analysis targets explicitly defined direct and indirect effects and requires assumptions suited to those targets. These approaches are not interchangeable ways to obtain a more “fully adjusted” answer.

Check Your Understanding

Answer each question, then compare with the solutions.

  1. In the additive model, let \(\alpha_1=1.5\), \(\beta_1=2\), and \(\beta_2=4\). What are the modeled total effect and mediated component, in outcome units?
  2. In one sentence, distinguish the total effect from the controlled direct effect at \(m\).
  3. Why does randomization of \(A\) not guarantee that a regression of \(Y\) on \(A\) and \(M\) has treatment coefficient \(\beta_1\)?
  4. If treatment and mediator interact in their effect on the outcome, what extra detail may be needed to describe a controlled direct effect?

Solutions. (1) The mediated component is \(\beta_2\alpha_1=4(1.5)=6\) outcome units; the total effect is \(\beta_1+\beta_2\alpha_1=2+6=8\) outcome units. (2) The total effect compares treatment conditions while allowing the mediator to take its treatment-specific value, whereas the controlled direct effect compares treatment conditions while setting the mediator to the same specified value \(m\). (3) Randomization does not ensure \(E[U_Y\mid A,M]=0\); conditioning on the mediator can leave mediator–outcome dependence that changes the regression coefficient. (4) The mediator level \(m\) matters, because the controlled direct effect may differ across mediator values.

Clinical Biostats