Tutorials › Causal Inference › Baseline Mediator-Outcome Confounding

Mediation and Path-Specific Effects · Tutorial 788 of 972

Baseline Mediator-Outcome Confounding

See how baseline mediator–outcome confounding enters the mediation formula and how stratum-specific results are standardized to the baseline covariate distribution.

Advanced 11 min read

What You'll Learn

  • Define a baseline mediator–outcome confounder and distinguish it from a post-treatment variable.
  • State the assumptions needed to identify natural effects when measured baseline confounding is present.
  • Derive the covariate-adjusted mediation formula.
  • Calculate natural-effect contrasts by standardizing conditional quantities across covariate strata.
  • Explain why pooled mediator and outcome distributions can give a misleading mediation calculation.
  • Match the standardization weights to the population targeted by the effect.

Why Baseline Confounding Matters in Mediation

A mediator–outcome association does not, by itself, show that changing the mediator would change the outcome. A pretreatment variable may influence both. For example, baseline disease severity may affect whether a patient receives a treatment-related behavioral change and may also predict the later clinical outcome. If severity is ignored, the mediator distribution and the outcome distribution can be combined in a way that does not identify a natural effect.

The remedy for a measured baseline common cause is to condition on it when relating the mediator to the outcome and when describing the mediator distribution under each treatment level. Then average the resulting conditional quantities over the baseline covariate distribution in the target population. This is standardization: adjustment is done within covariate strata first, not by treating the pooled mediator and outcome distributions as if the covariate were absent.

Definition: A baseline mediator–outcome confounder is a variable measured before treatment that is a common cause of the mediator and outcome. Write this variable as \(C\). It is baseline because its value is not caused by treatment. In this tutorial, \(A\) denotes treatment, \(M\) the mediator, and \(Y\) the outcome.

The word “baseline” matters. The formula below concerns a covariate \(C\) that precedes treatment. It does not cover a mediator–outcome confounder that is itself changed by treatment. The standard mediation notation is \(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 nested outcome \(Y_{a,M_{a'}}\) combines treatment \(a\) with the mediator value that would occur under treatment \(a'\).

The Covariate-Adjusted Mediation Formula

For treatment levels \(a\) and \(a'\), define the nested mean \(E[Y_{a,M_{a'}}]\). The mediation formula with baseline covariates expresses this mean using observed conditional outcome means, observed conditional mediator distributions, and the covariate distribution in the target population.

Identification result: Under consistency; treatment exchangeability conditional on \(C\); mediator–outcome exchangeability conditional on treatment and \(C\); the cross-world independence \(Y_{a,m} \perp M_{a'} \mid C\); and the relevant positivity conditions,
$$ E[Y_{a,M_{a'}}] = \sum_c \sum_m E[Y\mid A=a,M=m,C=c]\, P(M=m\mid A=a',C=c)\, P(C=c). $$

For continuous \(C\) or \(M\), the corresponding sums are integrals. The weights \(P(C=c)\) refer to the baseline covariate distribution of the population for which the effect is being reported. This distribution may be the study population or another clearly specified target population.

The assumptions have distinct roles. Treatment exchangeability requires that, conditional on \(C\), treatment assignment does not leave uncontrolled common causes of treatment and the relevant potential outcomes or mediator. Mediator–outcome exchangeability requires that, conditional on treatment and \(C\), there are no unmeasured common causes of mediator and outcome. The cross-world condition connects the potential outcome under one treatment and mediator value to the mediator under another treatment; it is an additional assumption used to identify natural effects. Consistency links observed outcomes and mediators to their corresponding potential outcomes. Positivity requires that the treatment and mediator values needed for the formula occur with positive probability within the covariate strata being averaged.

If treatment is randomized, treatment exchangeability is supported by randomization, though positivity and the other assumptions are still needed. A randomized treatment does not automatically remove mediator–outcome confounding: baseline \(C\) can still cause both \(M\) and \(Y\). Also, conditioning on \(C\) is useful only to the extent that the relevant confounders are measured and the conditional comparisons have adequate support.

Why the Formula Standardizes Within Strata

The formula can be understood by separating two operations. First, within each \(C=c\) stratum, use the mediator distribution under \(a'\) to average the outcome mean under treatment \(a\). Second, average those stratum-specific results using the target population’s \(P(C=c)\). The mediator distribution and outcome mean are both conditional on the same covariate value; this is what prevents the baseline common cause from creating a spurious mediator–outcome comparison.

1
Estimate the conditional outcome mean.
For each relevant \(a,m,c\), obtain \(E[Y\mid A=a,M=m,C=c]\).
2
Estimate the conditional mediator distribution.
For each \(a',c\), obtain \(P(M=m\mid A=a',C=c)\).
3
Average within each stratum, then across strata.
Multiply the conditional outcome mean by the conditional mediator probability, sum over \(m\), and then average over \(C\) using target-population weights.

A short derivation makes clear where each part enters. For discrete \(M\), first expand the nested mean over the possible mediator values. The cross-world independence lets us replace the conditional potential outcome mean among those with \(M_{a'}=m\) by its mean conditional on \(C=c\). Exchangeability and consistency then link that mean and the mediator probability to observed conditional quantities.

$$ \begin{aligned} E[Y_{a,M_{a'}}] &= \sum_c P(C=c)\sum_m E[Y_{a,m}\mid M_{a'}=m,C=c]\, P(M_{a'}=m\mid C=c)\\ &= \sum_c P(C=c)\sum_m E[Y_{a,m}\mid C=c]\, P(M_{a'}=m\mid C=c)\\ &= \sum_c P(C=c)\sum_m E[Y\mid A=a,M=m,C=c]\, P(M=m\mid A=a',C=c). \end{aligned} $$

The second line uses \(Y_{a,m} \perp M_{a'}\mid C\). The final line uses the exchangeability and consistency assumptions to identify the potential-outcome quantities from observed data. This derivation also shows why a pooled calculation generally does not work: it drops the shared stratum \(C=c\) before combining the mediator and outcome pieces.

Natural direct and indirect effects are contrasts between these nested means. For example, on an additive scale, one common indirect contrast holds treatment at \(a\) and changes the mediator distribution from that under \(a'\) to that under \(a\):

$$ E[Y_{a,M_a}]-E[Y_{a,M_{a'}}]. $$

The corresponding direct contrast holds the mediator distribution at that under \(a'\) and changes treatment from \(a'\) to \(a\). The covariate-adjusted formula applies to each nested mean in the contrast. These contrasts are on the outcome’s scale and retain the chosen target distribution of \(C\).

Worked Example: Standardizing Symptom Scores Across Baseline Severity

Suppose a hypothetical randomized study compares \(A=0\) with \(A=1\). Baseline severity \(C\) is low or high, and is a common cause of a behavioral mediator \(M\) and a later symptom score \(Y\), measured in points. Assume the identification conditions above hold, and suppose half of the target population has low severity and half high severity. The hypothetical mediator probabilities and conditional outcome means are:

Baseline severity\(P(M=1\mid A=0,C)\)\(P(M=1\mid A=1,C)\)Mean \(Y\), \(A=0,M=0\)Mean \(Y\), \(A=0,M=1\)Mean \(Y\), \(A=1,M=0\)Mean \(Y\), \(A=1,M=1\)
Low0.200.6010141216
High0.400.8020262228

To calculate \(E[Y_{1,M_0}]\), use the outcome means under \(A=1\) and the mediator distribution under \(A=0\), separately within each severity stratum. In the low-severity stratum, the conditional mean is \(0.80(12)+0.20(16)=12.8\) points. In the high-severity stratum, it is \(0.60(22)+0.40(28)=24.4\) points. Standardize using the target weights:

$$ E[Y_{1,M_0}] =0.50(12.8)+0.50(24.4)=18.6\text{ points}. $$

For \(E[Y_{1,M_1}]\), the mediator probabilities are those under \(A=1\). The low-severity mean is \(0.40(12)+0.60(16)=14.4\) points, and the high-severity mean is \(0.20(22)+0.80(28)=26.8\) points. Thus,

$$ E[Y_{1,M_1}] =0.50(14.4)+0.50(26.8)=20.6\text{ points}. $$

The indirect contrast at treatment \(A=1\) is \(20.6-18.6=2.0\) points. Under the stated assumptions, shifting the mediator distribution from that under \(A=0\) to that under \(A=1\), while holding treatment at \(A=1\), corresponds to a 2.0-point increase in the mean symptom score for this target population. The calculation has not averaged over severity until after forming the within-stratum quantities.

Worked Example: The Target Population Determines the Averaging Weights

Keep the conditional quantities in the previous hypothetical example, but suppose the target population has 80% low severity and 20% high severity. This changes the standardization weights, not the within-stratum mediator probabilities or outcome means. For \(E[Y_{1,M_0}]\), the stratum-specific means remain 12.8 and 24.4 points, so:

$$ E[Y_{1,M_0}] =0.80(12.8)+0.20(24.4) =10.24+4.88 =15.12\text{ points}. $$

For \(E[Y_{1,M_1}]\), the stratum-specific means remain 14.4 and 26.8 points:

$$ E[Y_{1,M_1}] =0.80(14.4)+0.20(26.8) =11.52+5.36 =16.88\text{ points}. $$

The indirect contrast for this target population is \(16.88-15.12=1.76\) points. It differs from the 2.0-point contrast above because the target population places different weight on the two severity strata. The formula is not tied to one universal set of covariate weights: the weights must match the population to which the effect is meant to apply.

Worked Example: Standardizing Hypothetical Risks

Consider a separate hypothetical study with a binary outcome. Let \(C\) again have low and high strata, with target-population proportions 0.60 and 0.40. Suppose the mediator probabilities under \(A=0\) are 0.25 in the low stratum and 0.50 in the high stratum; under \(A=1\), they are 0.55 and 0.75. The conditional outcome risks under \(A=1\) are 0.10 for \(M=0\) and 0.30 for \(M=1\) at low severity, and 0.20 and 0.50 at high severity. Assume the identification conditions and positivity hold.

First calculate the stratum-specific risks for \(E[Y_{1,M_0}]\). At low severity, \(0.75(0.10)+0.25(0.30)=0.15\). At high severity, \(0.50(0.20)+0.50(0.50)=0.35\). Therefore,

$$ E[Y_{1,M_0}] =0.60(0.15)+0.40(0.35) =0.09+0.14 =0.23. $$

For \(E[Y_{1,M_1}]\), the low-severity risk is \(0.45(0.10)+0.55(0.30)=0.21\), and the high-severity risk is \(0.25(0.20)+0.75(0.50)=0.425\). Standardizing gives

$$ E[Y_{1,M_1}] =0.60(0.21)+0.40(0.425) =0.126+0.170 =0.296. $$

The indirect contrast at \(A=1\) is \(0.296-0.230=0.066\), or 6.6 percentage points in risk. This is a population-average contrast under the specified target distribution of baseline severity, not a comparison of risks among people observed to have different mediator values.

Common Mistakes and Practical Checks

A common mistake is to calculate a pooled outcome mean for each mediator value and combine it with a pooled mediator distribution, reasoning that the treatment groups or the whole sample are large enough to average out baseline differences. That calculation can compare people with different severity distributions across mediator levels. Because severity predicts both mediator and outcome, the pooled mediator–outcome relationship can partly reflect severity rather than the mediator pathway. The correction is to calculate the outcome and mediator quantities conditional on \(C\), combine them within each stratum, and only then average using the intended \(P(C)\).

Another mistake is to report a conditional regression coefficient for the mediator as though it were a natural indirect effect. A coefficient from a model conditional on \(C\) is not automatically the standardized nested mean contrast. The formula requires both the conditional outcome model and the conditional mediator distribution, followed by averaging over the target covariate distribution. Treatment–mediator interaction can also make the relevant outcome means depend jointly on \(A\) and \(M\); the conditional formula accommodates that dependence by retaining both values in the outcome mean.

Before interpreting an adjusted mediation result, check that \(C\) truly precedes treatment, that the important mediator–outcome common causes have been measured, and that the necessary treatment and mediator combinations occur within the covariate strata. Sparse or empty strata undermine positivity and make the formula unsupported by the observed data. Finally, standardization controls measured baseline confounding only under the stated assumptions; it does not turn an unmeasured mediator–outcome common cause into a measured one.

Key takeaway: With a measured pretreatment mediator–outcome confounder, identify each nested mean by combining the outcome mean under \(A=a\) and the mediator distribution under \(A=a'\) within the same \(C\) stratum, then average over the target population’s baseline covariate distribution.

Check Your Understanding

Use the conditional formula and the role of standardization to answer these questions.

  1. What makes a variable a baseline mediator–outcome confounder, and why would a variable caused by treatment not fit this definition?
  2. In \(E[Y_{a,M_{a'}}]\), which treatment level indexes the conditional outcome mean, and which indexes the mediator distribution?
  3. Why does the formula condition on \(C\) before averaging over its distribution?
  4. If the target population has more people in a high-severity stratum than the study population, what part of standardization changes?
  5. In the binary-outcome example, interpret the 0.066 contrast in context and state its units.
Clinical Biostats