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.
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:
The probability of receiving \(A_1=1\) depends on both treatments and the intermediate covariate:
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:
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.
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:
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:
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:
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:
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:
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:
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.
Estimate each person's probability of the treatment actually received, conditional on the observed treatment and covariate history.
Divide the numerator probability by the history-conditional denominator probability, using the appropriate factor for each visit.
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:
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:
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:
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.
Check Your Understanding
Answer each question using the two-visit setup and the distinction between conditional and marginal effects.
- Which feature of the example makes \(L_1\) a treatment-affected confounder rather than a baseline confounder?
- For \(A_0=1,L_1=1,A_1=1\), what stabilized second-visit weight follows from the probabilities in the example?
- Why does adding the ordinary regression coefficients for \(A_0\) and \(A_1\) not recover the sustained-regime risk difference here?
- State the role of the numerator and denominator in the stabilized treatment weight.
- Name one identification condition that weighting cannot repair if it fails.