Tutorials › Causal Inference › Comparing Ordinary and Weighted Regression Under Feedback

Marginal Structural Models · Tutorial 751 of 972

Comparing Ordinary and Weighted Regression Under Feedback

Trace treatment-confounder feedback through a hypothetical two-visit study and compare an adjusted regression coefficient with a correctly weighted marginal contrast.

Advanced 10 min read

What You'll Learn

  • Identify treatment-confounder feedback in a two-visit causal structure.
  • Calculate stabilized treatment weights for a time-varying confounder.
  • Explain why an adjusted regression coefficient need not equal a marginal regime effect.
  • Derive how weighting balances the time-varying confounder across later-treatment groups.
  • Compute and compare ordinary-regression and weighted-MSM contrasts on the risk-difference scale.

Why feedback changes the regression question

In longitudinal studies, a covariate measured after an initial treatment may be affected by that treatment and also predict a later treatment and the outcome. This is treatment-confounder feedback. The covariate is a confounder of the later treatment-outcome relationship, but it is also part of the pathway by which the initial treatment can affect the outcome. Simply including it as an ordinary regression covariate can therefore change the question answered by a treatment coefficient.

A marginal structural model (MSM) approaches the problem differently: treatment weights construct a pseudo-population in which treatment assignment is no longer associated with measured time-varying confounders, conditional on the modeled history. The outcome model can then describe marginal outcomes under treatment regimes without adjusting for the treatment-affected confounder. The example below isolates this distinction on the risk-difference scale.

Definition: Let \(A_0\) denote treatment at the first visit, \(L_1\) a covariate measured between visits, \(A_1\) treatment at the second visit, and \(Y\) the later outcome. Treatment-confounder feedback occurs when \(A_0\) affects \(L_1\), while \(L_1\) predicts both \(A_1\) and \(Y\). A treatment regime \((a_0,a_1)\) specifies the treatment values that would be assigned at both visits. The marginal regime mean \(E[Y^{a_0,a_1}]\) is the mean outcome that would occur if everyone followed that regime.

A hypothetical two-visit data-generating process

Consider a hypothetical study with binary treatments, a binary intermediate covariate, and a binary outcome. There are no baseline confounders in this example, and \(A_0\) is randomized with probability \(0.5\). The intermediate covariate is more common after initial treatment:

$$ P(L_1=1\mid A_0=0)=0.20,\qquad P(L_1=1\mid A_0=1)=0.80. $$

The probability of receiving \(A_1=1\) depends on both treatments and the intermediate covariate:

$$ \begin{aligned} P(A_1=1\mid A_0=0,L_1=0)&=0.20, & P(A_1=1\mid A_0=0,L_1=1)&=0.60,\\ P(A_1=1\mid A_0=1,L_1=0)&=0.30, & P(A_1=1\mid A_0=1,L_1=1)&=0.90. \end{aligned} $$

Thus \(L_1\) is treatment-affected and predicts later treatment. Suppose the outcome follows this conditional mean model, with a Bernoulli outcome given the variables:

$$ E[Y\mid A_0,A_1,L_1] =0.05+0.15A_0+0.20A_1+0.25L_1. $$

All resulting risks are between 0 and 1. The model makes \(L_1\) a predictor of the outcome as well. These probabilities and risks are hypothetical, not results from a real study.

Identification conditions for this example: Consistency means that a person's observed outcome equals the potential outcome under the treatment history that person received. Sequential exchangeability means that, at each visit, treatment is independent of the relevant future potential outcomes conditional on the measured treatment and covariate history available just before that treatment. Here \(A_0\) is randomized, and the example assumes that \(A_1\) is unconfounded conditional on \((A_0,L_1)\). Positivity requires positive probability of each treatment value within every history used for comparison; the specified probabilities satisfy this condition. These conditions, together with correctly specified treatment weights, support identification of the regime means in this example.

Worked Example: Calculating a stabilized treatment weight

Worked Example: Calculating a stabilized treatment weight

For people with \(A_0=1\), calculate the numerator probability for \(A_1=1\), then find the stabilized weight for someone with \(L_1=0\) who received \(A_1=1\).

The numerator is the probability of the observed later treatment given \(A_0\), averaging over \(L_1\) in that \(A_0\) group. For \(A_0=1\), the probability of \(L_1=1\) is \(0.80\), so:

$$ P(A_1=1\mid A_0=1) =(0.20)(0.30)+(0.80)(0.90) =0.06+0.72=0.78. $$

For a stabilized weight, divide this numerator by the probability of the observed \(A_1\) given the full measured history. For the specified person, the denominator is \(P(A_1=1\mid A_0=1,L_1=0)=0.30\). Therefore:

$$ SW_1=\frac{P(A_1=1\mid A_0=1)} {P(A_1=1\mid A_0=1,L_1=0)} =\frac{0.78}{0.30}=2.60. $$

The weight is greater than one because, among people with \(A_0=1\), receiving \(A_1=1\) with \(L_1=0\) was less likely than the numerator model predicts. The numerator retains the dependence of later treatment on prior treatment; the denominator additionally accounts for the measured time-varying confounder. With randomized \(A_0\) and no baseline covariates, the corresponding first-visit numerator and denominator cancel.

Why ordinary adjustment can miss a marginal contrast

An ordinary regression that conditions on \(A_0,A_1,L_1\) is correctly specified for this example's conditional outcome mean. Its coefficients for \(A_0\) and \(A_1\) are \(0.15\) and \(0.20\). But these are conditional contrasts: each compares treatment values while holding \(L_1\) fixed. In particular, holding \(L_1\) fixed removes the part of the initial treatment's effect that operates through changing \(L_1\).

The target of interest here is instead the marginal risk under each treatment regime. Under a regime, the distribution of \(L_1\) is the distribution that would arise under its assigned \(A_0\). Averaging the conditional outcome model over that distribution gives:

$$ E[Y^{a_0,a_1}] =\sum_{l=0}^1 E[Y\mid A_0=a_0,A_1=a_1,L_1=l]\, P(L_1=l\mid A_0=a_0). $$

This calculation is the g-formula for this simple example. It uses the outcome model and the covariate distribution under the initial treatment; it does not treat \(L_1\) as if it were a baseline covariate unaffected by treatment.

Worked Example: Interpreting the ordinary adjusted regression

In the hypothetical outcome model, the adjusted regression is \(E[Y\mid A_0,A_1,L_1]=0.05+0.15A_0+0.20A_1+0.25L_1\). What contrast would be obtained by adding its two treatment coefficients to compare \(A_0=A_1=1\) with \(A_0=A_1=0\)?

The coefficient-based contrast is:

$$ 0.15+0.20=0.35. $$

This is a conditional-model contrast that holds \(L_1\) fixed. It is not the marginal contrast between the two treatment regimes. For example, the mean of \(L_1\) is \(0.80\) under \(A_0=1\) and \(0.20\) under \(A_0=0\). That change contributes to the marginal outcome difference through the \(0.25L_1\) term. The coefficient sum does not include this contribution, so it answers a different question from the total regime comparison.

What the treatment weights balance

For the second visit, the stabilized weight for a person with observed \(A_1=a_1\) is:

$$ SW_1= \frac{P(A_1=a_1\mid A_0)} {P(A_1=a_1\mid A_0,L_1)}. $$

In the weighted pseudo-population, the distribution of \(L_1\) among people with a given \(A_0\) and \(A_1\) matches its distribution among people with that \(A_0\), rather than depending on \(A_1\). To see why, the original conditional probability for a covariate value and treatment value is multiplied by the weight:

$$ P(L_1=l\mid A_0=a_0) P(A_1=a_1\mid A_0=a_0,L_1=l) \frac{P(A_1=a_1\mid A_0=a_0)} {P(A_1=a_1\mid A_0=a_0,L_1=l)} \propto P(L_1=l\mid A_0=a_0). $$

The treatment probability conditional on \(L_1\) cancels. After normalization across values of \(l\), the weighted distribution of \(L_1\) no longer varies with \(A_1\) within levels of \(A_0\). This is the key reason an outcome model for the MSM can omit \(L_1\): weighting, rather than outcome-model adjustment for \(L_1\), removes the measured confounding of the later treatment.

1
Model treatment assignment.
Estimate each person's probability of the treatment actually received, conditional on the observed treatment and covariate history.
2
Construct the treatment weight.
Divide the numerator probability by the history-conditional denominator probability, using the appropriate factor for each visit.
3
Fit a marginal outcome model.
Use the weights in an MSM for the outcome and treatment history, without including the treatment-affected confounder as an ordinary outcome-model adjustment variable.

Worked Example: Computing the marginal regime contrast

Worked Example: Computing the marginal regime contrast

Calculate the risks under the sustained regimes \((0,0)\) and \((1,1)\), then compare the risk difference with the ordinary regression coefficient sum.

Under \((0,0)\), \(L_1\) has probability \(0.20\) of being one. The conditional risks are \(0.05\) when \(L_1=0\) and \(0.30\) when \(L_1=1\). Thus:

$$ E[Y^{0,0}] =(0.80)(0.05)+(0.20)(0.30) =0.04+0.06=0.10. $$

Under \((1,1)\), \(L_1\) has probability \(0.80\) of being one. The conditional risks are \(0.40\) when \(L_1=0\) and \(0.65\) when \(L_1=1\). Therefore:

$$ E[Y^{1,1}] =(0.20)(0.40)+(0.80)(0.65) =0.08+0.52=0.60. $$

The marginal regime risk difference is \(0.60-0.10=0.50\), or 50 percentage points. In this example, the ordinary adjusted-regression coefficient sum was \(0.35\), or 35 percentage points. The difference arises because the marginal regime contrast includes the change in \(L_1\) distribution induced by \(A_0\), whereas the coefficient sum holds \(L_1\) fixed.

The weighted MSM and its interpretation

The four regime means in this example are \(0.10\) under \((0,0)\), \(0.30\) under \((0,1)\), \(0.40\) under \((1,0)\), and \(0.60\) under \((1,1)\). They are represented exactly by this risk-scale MSM:

$$ E[Y^{a_0,a_1}]=0.10+0.30a_0+0.20a_1. $$

A correctly weighted fit of this model targets marginal regime means. Its coefficient \(0.30\) for \(A_0\) includes both the conditional contribution of \(A_0\) in the outcome model and the effect transmitted through the changed distribution of \(L_1\). The coefficient \(0.20\) for \(A_1\) is the marginal risk difference for changing the second-visit treatment while holding the first-visit regime value fixed. Adding them gives the sustained-regime contrast \(0.50\).

The equality between the weighted estimate and the target depends on the stated identification conditions and correctly specified treatment weights. Weighting is not a guarantee against unmeasured confounding, lack of positivity, or a misspecified treatment model. In finite samples, extreme weights can also make estimates unstable. The comparison here concerns what the two procedures target under the example's assumptions, not a claim that weighting is always numerically more precise.

Common mistake: treating every adjusted coefficient as a total effect

  • Wrong reasoning: “The adjusted regression includes \(L_1\), which predicts both \(A_1\) and \(Y\), so its treatment coefficients must be the total causal effects.”
  • Correction: Including \(L_1\) controls the later-treatment confounding in the conditional outcome model, but it also holds fixed a variable affected by \(A_0\). The resulting coefficient is not automatically the marginal effect of a treatment regime.
  • Important qualification: Ordinary regression can be used as part of a valid analysis if its fitted conditional means are standardized over the appropriate covariate distributions. That is a different calculation from interpreting the adjusted treatment coefficients directly. A correctly specified, correctly weighted MSM instead targets marginal regime means through the weighted outcome fit.
Key takeaway: When an intermediate covariate is affected by earlier treatment and confounds later treatment, ordinary adjustment and treatment weighting serve different roles. An adjusted coefficient can be conditional on that covariate; a correctly weighted MSM targets marginal outcomes under specified treatment regimes.

Check Your Understanding

Answer each question using the two-visit setup and the distinction between conditional and marginal effects.

  1. Which feature of the example makes \(L_1\) a treatment-affected confounder rather than a baseline confounder?
  2. For \(A_0=1,L_1=1,A_1=1\), what stabilized second-visit weight follows from the probabilities in the example?
  3. Why does adding the ordinary regression coefficients for \(A_0\) and \(A_1\) not recover the sustained-regime risk difference here?
  4. State the role of the numerator and denominator in the stabilized treatment weight.
  5. Name one identification condition that weighting cannot repair if it fails.
Clinical Biostats