Tutorials › Marginal Structural Models › How Adjusting For A Confounder Can Block An Earlier Effect

Time-Varying Treatments and Confounder Feedback · Tutorial 7 of 501

How Adjusting For A Confounder Can Block An Earlier Effect

See algebraically why adjusting for a post-treatment confounder can remove part of an earlier treatment’s effect, and learn when that interpretation requires care.

Intermediate 11 min read

What You'll Learn

  • Identify the post-treatment covariate that lies on an earlier treatment’s pathway to the outcome.
  • Derive the treatment effect transmitted through that covariate in a linear model.
  • Compare an unadjusted treatment contrast with a contrast adjusted for the post-treatment covariate.
  • Calculate when adjustment changes the magnitude or sign of the earlier treatment contrast.
  • Recognize assumptions and diagnostics needed before interpreting an adjusted coefficient causally.

Why a Later Covariate Can Change an Earlier Treatment Contrast

In a two-period study, an earlier treatment can change a covariate measured before the next treatment decision. That covariate may then predict the final outcome and influence the later treatment. It is therefore a confounder of the later treatment–outcome relationship, but it is also potentially part of the pathway from the earlier treatment to the outcome.

This creates a specific problem for ordinary adjustment: holding the later covariate fixed removes the part of the earlier treatment’s effect that operates through changes in that covariate. The algebra below isolates this pathway. It does not say that adjustment is always wrong: the adjusted comparison answers a different question, and its causal interpretation depends on assumptions about treatment assignment and the outcome model.

Definition: Let \(A_0\) be the first treatment, \(L_1\) a covariate measured after \(A_0\) but before the second treatment, \(A_1\) the second treatment, and \(Y\) the outcome. A post-treatment covariate is a covariate measured after a treatment has been assigned. When \(A_0\) affects \(L_1\), and \(L_1\) in turn affects \(Y\), the pathway \(A_0 \to L_1 \to Y\) carries part of the effect of \(A_0\).

To focus on that pathway, consider comparisons made while \(A_1\) is held at a fixed value \(a_1\). The model is

$$ L_1 = \alpha_0 + \alpha_A A_0 + U,\qquad Y = \beta_0 + \beta_A A_0 + \beta_L L_1 + \beta_1 a_1 + \varepsilon. $$

Here \(U\) is the part of \(L_1\) not explained by \(A_0\), and \(\varepsilon\) is the part of \(Y\) not explained by the displayed terms. Assume \(E[U\mid A_0]=0\), \(E[\varepsilon\mid A_0,L_1]=0\), finite second moments, and that \(A_0\) varies in the population. These assumptions make the conditional means in the model correct. For a causal interpretation, also assume consistency and that the intervention on \(A_0\) being compared is well-defined. Additional assumptions are needed to identify the causal contrast from observational data.

Deriving the Effect That Adjustment Removes

Substituting the equation for \(L_1\) into the outcome equation gives

$$ Y = \beta_0 + \beta_A A_0 + \beta_L(\alpha_0+\alpha_A A_0+U) + \beta_1 a_1 + \varepsilon. $$

Taking the conditional expectation given \(A_0\), the assumptions on \(U\) and \(\varepsilon\) imply

$$ E[Y\mid A_0] = \beta_0+\beta_L\alpha_0+\beta_1a_1 +(\beta_A+\beta_L\alpha_A)A_0. $$

Thus, for this model and a fixed \(a_1\), the expected outcome contrast per one-unit increase in \(A_0\), allowing \(L_1\) to respond as the model specifies, is \(\beta_A+\beta_L\alpha_A\). The term \(\beta_L\alpha_A\) is the contribution transmitted through \(L_1\). In contrast, holding \(L_1\) fixed leaves only the coefficient \(\beta_A\).

Theorem: Under the stated linear model and conditional mean assumptions, the population linear regression of \(Y\) on an intercept, \(A_0\), and \(L_1\), within a fixed value \(A_1=a_1\), has coefficient \(\beta_A\) for \(A_0\). The conditional mean contrast when \(L_1\) is allowed to change with \(A_0\) has slope \(\beta_A+\beta_L\alpha_A\). The difference is \(\beta_L\alpha_A\).

Proof. The outcome equation itself is the conditional mean given \(A_0,L_1\), because \(E[\varepsilon\mid A_0,L_1]=0\). It is linear in \(A_0,L_1\), so its population regression coefficients are \(\beta_A\) and \(\beta_L\), provided these regressors are not perfectly collinear. The earlier substitution and conditional expectation show that the slope when \(L_1\) is allowed to vary with \(A_0\) is \(\beta_A+\beta_L\alpha_A\). Subtracting the adjusted coefficient gives

$$ (\beta_A+\beta_L\alpha_A)-\beta_A=\beta_L\alpha_A. $$

This difference is the modeled contribution through \(L_1\). If \(\alpha_A=0\), \(A_0\) does not change \(L_1\); if \(\beta_L=0\), \(L_1\) does not affect the outcome in this model. Either way, the pathway contribution is zero. \(\square\)

Worked Calculations

Worked Example: Adjustment Removes a Positive Pathway

Suppose \(A_0\) is binary, \(L_1=1+2A_0+U\), and \(Y=3+A_0+1.5L_1+\varepsilon\). Assume \(E[U\mid A_0]=0\) and \(E[\varepsilon\mid A_0,L_1]=0\), with \(A_1\) held fixed. Find the expected outcome contrast for \(A_0=1\) versus \(A_0=0\), and compare it with the adjusted coefficient.

The treatment changes the expected covariate by \(2\): \(E[L_1\mid A_0=1]=3\) and \(E[L_1\mid A_0=0]=1\). The direct contribution in the outcome equation is \(1\). The contribution through \(L_1\) is \(1.5(3-1)=3\). Therefore the expected outcome contrast allowing \(L_1\) to respond is \(1+3=4\).

If we compare people at the same \(L_1\), the \(1.5L_1\) term is held constant. The coefficient of \(A_0\) in the correctly specified regression of \(Y\) on \(A_0\) and \(L_1\) is \(1\). The difference, \(4-1=3\), is exactly the contribution through \(L_1\).

Worked Example: Checking the Regression Coefficients From Covariances

Use the same model, but now let \(A_0\sim\operatorname{Bernoulli}(0.5)\), \(U\) be independent of \(A_0\) with mean \(0\) and variance \(4\), and \(\varepsilon\) be independent of both with mean \(0\). Verify that the unadjusted regression slope is \(4\) while the slope adjusted for \(L_1\) is \(1\).

Since \(\operatorname{Var}(A_0)=0.25\) and \(L_1=1+2A_0+U\), we have \(\operatorname{Var}(L_1)=4(0.25)+4=5\) and \(\operatorname{Cov}(A_0,L_1)=2(0.25)=0.5\). From \(Y=3+A_0+1.5L_1+\varepsilon\),

$$ \operatorname{Cov}(A_0,Y)=0.25+1.5(0.5)=1,\qquad \operatorname{Cov}(L_1,Y)=0.5+1.5(5)=8. $$

The unadjusted slope is \(\operatorname{Cov}(A_0,Y)/\operatorname{Var}(A_0)=1/0.25=4\). For a regression on \(A_0\) and \(L_1\), the coefficient on \(A_0\) is

$$ \frac{\operatorname{Cov}(A_0,Y)\operatorname{Var}(L_1) -\operatorname{Cov}(L_1,Y)\operatorname{Cov}(A_0,L_1)} {\operatorname{Var}(A_0)\operatorname{Var}(L_1)-\operatorname{Cov}(A_0,L_1)^2} = \frac{1(5)-8(0.5)}{0.25(5)-(0.5)^2} = \frac{1}{1}=1. $$

The unadjusted slope is the contrast allowing the covariate to change with treatment; the adjusted coefficient holds it fixed in the linear conditional mean. This calculation verifies the theorem for a particular distribution rather than relying only on the structural equations.

Worked Example: Adjustment Can Reverse the Contrast’s Sign

Let \(A_0\) be binary, \(E[L_1\mid A_0]=A_0\), and \(E[Y\mid A_0,L_1]=1+A_0-2L_1\), with \(A_1\) fixed and errors satisfying the conditional mean assumptions. What are the adjusted and covariate-allowing contrasts?

The adjusted coefficient of \(A_0\) is \(1\): at the same \(L_1\), changing \(A_0\) by one changes the modeled mean outcome by one. But \(A_0\) also increases the expected \(L_1\) by one, and each unit increase in \(L_1\) decreases the expected outcome by two. The pathway contribution is therefore \((-2)(1)=-2\), and the contrast allowing \(L_1\) to respond is \(1-2=-1\).

Equivalently, \(E[Y\mid A_0=0]=1\), while \(E[Y\mid A_0=1]=1+1-2=-0\). The difference is \(-0-1=-1\). The positive adjusted coefficient and negative covariate-allowing contrast answer different questions; neither arithmetic nor the model implies that one is a mistake.

Assumptions, Diagnostics, and Alternatives

The algebra identifies what adjustment does in the stated model; it does not, by itself, guarantee that a regression coefficient in observational data is a causal effect. The linear conditional mean must be adequate for the intended contrast, the treatment and covariate must have sufficient variation to estimate the regression, and the error must have conditional mean zero given the included regressors. For causal interpretation, treatment assignment must also be adequately controlled for by the design or assumptions. In particular, unmeasured causes of \(L_1\) and \(Y\), misspecification, or poor overlap can invalidate a causal reading.

The fixed-\(A_1\) setup is deliberate: it isolates the \(A_0 \to L_1 \to Y\) pathway. In practice, \(A_1\) is often assigned in response to \(L_1\). Conditioning on \(A_1\) as well as \(L_1\) can change the comparison further, and may introduce additional bias if the treatment assignment structure is not handled appropriately. The calculation here should not be mistaken for a general formula for the effect of a treatment regime.

Useful diagnostics include checking whether \(L_1\) differs across levels of \(A_0\), examining the relationship between \(L_1\) and \(Y\), and assessing overlap in \(L_1\) across treatment groups. In the linear model, these correspond to asking whether \(\alpha_A\) and \(\beta_L\) may be nonzero. Plotting or fitting flexible conditional mean models can also reveal nonlinearity or treatment-by-covariate variation that a single linear coefficient conceals. Diagnostics cannot establish the absence of unmeasured confounding, but they can expose obvious failures of the working model or lack of empirical support.

A regression that adjusts only for baseline covariates does not hold this post-treatment covariate fixed, so it does not remove this particular pathway by that adjustment. It may nevertheless leave confounding of the later treatment unresolved. Marginal structural models and the g-formula are alternative approaches designed for longitudinal treatment and covariate histories; their role is not to reinterpret the ordinary adjusted coefficient as a total effect, but to target specified treatment comparisons under their own identification and modeling assumptions.

Common mistake: “\(L_1\) predicts \(Y\) and confounds the later treatment, so adjusting for \(L_1\) must improve the estimate of the effect of \(A_0\).” The correction is that \(L_1\) is after \(A_0\): adjustment can control part of the later-treatment confounding while also blocking the pathway \(A_0 \to L_1 \to Y\). First state which treatment contrast is wanted, then decide whether conditioning on \(L_1\) targets it.

Check Your Understanding

For each question, use the linear model logic above. Solutions are included so you can check each step.

  1. If \(\alpha_A=3\), \(\beta_L=2\), and \(\beta_A=1\), what are the covariate-allowing slope and the adjusted coefficient? How much of their difference is through \(L_1\)?
  2. In the model \(L_1=\alpha_0+\alpha_AA_0+U\), what happens to the pathway contribution if \(\alpha_A=0\)? Explain.
  3. Suppose \(\alpha_A=-1\), \(\beta_L=4\), and \(\beta_A=2\). Calculate both slopes and state whether adjustment increases or decreases the coefficient relative to the covariate-allowing contrast.
  4. Why does the theorem not establish that an adjusted regression coefficient is automatically a causal effect in observational data?

Solutions. (1) The covariate-allowing slope is \(1+2(3)=7\). The adjusted coefficient is \(1\), and the difference \(6\) equals \(\beta_L\alpha_A=2(3)\). (2) The contribution is \(\beta_L\alpha_A=0\); in this model, changing \(A_0\) does not change the mean of \(L_1\), so there is no pathway through that covariate. (3) The covariate-allowing slope is \(2+4(-1)=-2\); the adjusted coefficient is \(2\). Adjustment raises the coefficient by \(4\), while the pathway contribution is \(-4\). (4) The theorem assumes a correctly specified conditional mean and conditional mean-zero errors, and a causal interpretation additionally requires suitable treatment-assignment assumptions, consistency, and adequate support. Those conditions do not follow merely from fitting a regression.

Clinical Biostats