Why Treatment-Confounder Feedback Creates a Problem
In longitudinal studies, a covariate measured after one treatment may help determine the next treatment and the outcome. If the earlier treatment also changes that covariate, it is a time-varying confounder affected by prior treatment. This creates treatment-confounder feedback: the covariate is both part of the pathway from earlier treatment to outcome and a confounder of later treatment and outcome.
The resulting dilemma is easy to state. Leaving the covariate out of an outcome regression can leave the later treatment confounded. Adjusting for it can block part of the earlier treatment's effect. Inverse-probability weighting offers another approach: reweight observations according to their treatment probabilities so that, in the weighted data, later treatment is no longer associated with the measured past covariates that confounded its assignment. The outcome analysis can then compare treatment histories without conditioning on the affected covariate.
Consider two treatment times. Let \(A_0\) be treatment at the first time, \(L_1\) a covariate measured after \(A_0\) but before the next treatment, \(A_1\) treatment at the second time, and \(Y\) the final outcome. A typical causal structure includes the paths \(A_0 \rightarrow L_1 \rightarrow Y\), \(L_1 \rightarrow A_1 \rightarrow Y\), and \(A_0 \rightarrow Y\). The first path makes \(L_1\) a mediator of some of \(A_0\)'s effect; the second makes it a confounder of the \(A_1\)-outcome relationship.
A Numerical Example of the Feedback
Suppose a hypothetical population contains 1,000 people. The first treatment \(A_0\) is assigned at random, with 500 people receiving each value. Treatment affects the later binary covariate \(L_1\): among those with \(A_0=0\), 20% have \(L_1=1\); among those with \(A_0=1\), 80% have \(L_1=1\). The later treatment is more likely when \(L_1=1\): \(P(A_1=1\mid A_0,L_1)=0.8\) if \(L_1=1\), and \(0.2\) if \(L_1=0\).
Assume, for this illustration, that the outcome in points follows the hypothetical equation \(Y=10+4A_0+6L_1+5A_1\). The equation makes the calculation transparent: holding the other variables fixed, changing \(A_0\) adds 4 points, changing \(L_1\) adds 6 points, and changing \(A_1\) adds 5 points. The equation is a stipulated data-generating model for this example, not a claim about real patients or a general outcome model.
Worked Example: The Marginal Effect of the First Treatment
Compare the treatment histories \((A_0,A_1)=(0,0)\) and \((1,0)\), allowing \(L_1\) to take the distribution induced by each first treatment. Under \(A_0=0\), the expected value of \(L_1\) is \(0.2\); under \(A_0=1\), it is \(0.8\).
For history \((0,0)\), the mean outcome is \(10+4(0)+6(0.2)+5(0)=11.2\) points. For history \((1,0)\), it is \(10+4(1)+6(0.8)+5(0)=18.8\) points.
The contrast is \(18.8-11.2=7.6\) points. It includes the direct 4-point contribution from \(A_0\) and the \(6(0.8-0.2)=3.6\)-point contribution through the change in \(L_1\). A regression coefficient for \(A_0\) that holds \(L_1\) fixed would capture the 4-point conditional contrast in this model, not this 7.6-point marginal contrast.
The same covariate that carries part of the effect of \(A_0\) also confounds the association between \(A_1\) and \(Y\). Because \(L_1\) predicts \(A_1\) and contributes 6 points to \(Y\), people with \(A_1=1\) will tend to have higher outcomes even apart from the effect of \(A_1\). The example's treatment probabilities make that association substantial.
Worked Example: Confounding in the Observed Later-Treatment Comparison
The expected cell counts follow from the stated probabilities. Among the 500 people with \(A_0=0\), 100 have \(L_1=1\) and 400 have \(L_1=0\). Among the 500 with \(A_0=1\), the corresponding counts are 400 and 100.
For \(L_1=1\), 80% receive \(A_1=1\); for \(L_1=0\), 20% do. Thus, among people with \(A_1=1\), 400 have \(L_1=1\) and 100 have \(L_1=0\). Among people with \(A_1=0\), 100 have \(L_1=1\) and 400 have \(L_1=0\). The proportion with \(L_1=1\) is therefore \(400/500=0.8\) in the treated group and \(100/500=0.2\) in the untreated group.
Because \(A_0\) was randomized, the expected proportion with \(A_0=1\) is 0.5 in the full population. But \(A_0\) and \(A_1\) are associated through \(L_1\): among those with \(A_1=1\), \(340/500=0.68\) have \(A_0=1\), whereas among those with \(A_1=0\), \(160/500=0.32\) do. Substituting these group proportions into the outcome equation gives an observed mean of \(10+4(0.68)+6(0.8)+5=22.52\) points for \(A_1=1\), and \(10+4(0.32)+6(0.2)=12.48\) points for \(A_1=0\). The observed difference is \(22.52-12.48=10.04\) points, not the 5-point effect of changing \(A_1\) while holding the other terms fixed.
This comparison is confounded: the groups differ in \(L_1\) and also in \(A_0\). It is not a causal estimate of the effect of \(A_1\).
How Inverse-Probability Weighting Changes the Comparison
For a two-time treatment history, an unstabilized treatment weight gives greater weight to observations whose received treatment was less likely given their measured history. In general, if \(X\) denotes baseline covariates, the weight for an observed history is
For a binary treatment, the probability in each denominator is the probability of the treatment value actually received. For example, the second factor is \(1/P(A_1=1\mid A_0,L_1,X)\) when \(A_1=1\), and \(1/P(A_1=0\mid A_0,L_1,X)\) when \(A_1=0\). The formula presumes that these probabilities are correctly specified or consistently estimated and positive for the treatment histories being compared. It also requires a suitable set of measured covariates for the causal interpretation; weighting cannot remove confounding by variables that were not measured and included.
In the hypothetical example, \(A_0\) is randomized, so its treatment probability is 0.5 for everyone and its weight factor is \(1/0.5=2\). The second factor is 1.25 for someone with \(L_1=1,A_1=1\), since \(1/0.8=1.25\); it is 5 for someone with \(L_1=1,A_1=0\), since \(1/0.2=5\). For \(L_1=0\), these factors are reversed: 5 for \(A_1=1\) and 1.25 for \(A_1=0\).
Worked Example: Balancing the Later Treatment Within a History
Focus on the 100 people with \(A_0=0,L_1=1\). The treatment probability is 0.8, so the expected counts are 80 with \(A_1=1\) and 20 with \(A_1=0\). Using just the second-time weight, the weighted counts are \(80(1/0.8)=100\) and \(20(1/0.2)=100\). Including the first-time factor of 2 doubles both to 200. The weighted counts are equal across the two values of \(A_1\) within this \(A_0,L_1\) stratum.
The same calculation applies in every stratum: if the stratum's treatment probability is \(q\), the expected treated count \(nq\), weighted by \(1/q\), becomes \(n\); the untreated count \(n(1-q)\), weighted by \(1/(1-q)\), also becomes \(n\). Thus, within levels of the measured history, weighted observations receiving either value of \(A_1\) represent equal total weight. In the resulting pseudo-population, \(A_1\) is balanced with respect to \(L_1\) within levels of \(A_0\), by construction.
The weighting operation changes the representation of the data, not each person's observed outcome. It also does not make \(L_1\) disappear or undo the effect of \(A_0\) on \(L_1\). Rather, it prevents the unequal probabilities of later treatment across \(L_1\) strata from making some histories dominate the comparison. Crucially, the outcome analysis need not condition on \(L_1\). The distribution of \(L_1\) can still differ by \(A_0\), preserving the pathway through which earlier treatment affects the outcome.
From the Weighted Data to a Marginal Contrast
A marginal structural model describes mean outcomes for treatment histories in the target population, rather than conditional means at a fixed value of a treatment-affected covariate. In this example, the marginal mean for a specified history is found by averaging over the distribution of \(L_1\) that would arise under its \(A_0\) value. The stipulated model gives
Here \(E[L_1\mid A_0=a_0]=0.2+0.6a_0\), as specified in the example. The marginal mean under history \((0,0)\) is 11.2 points; under \((1,1)\), it is \(11.2+7.6+5=23.8\) points. Their contrast is \(23.8-11.2=12.6\) points. A weighted outcome analysis that compares treatment histories without adjusting for \(L_1\) can target this kind of marginal contrast, subject to the causal assumptions and a suitable marginal model.
For that causal interpretation, the measured history must suffice to control confounding of treatment assignment at each time, treatment probabilities must be positive for the histories of interest, and the observed outcomes must correspond to the treatments actually received (consistency). The weight model and the marginal outcome model must also be adequate for the chosen analysis. These conditions are substantive as well as statistical: the arithmetic of weighting alone cannot verify them.
What Weighting Does—and Does Not—Solve
The key advantage is that weighting avoids choosing between two problematic forms of ordinary regression adjustment. Adjusting for \(L_1\) in a conditional outcome model can remove the \(A_0 \rightarrow L_1 \rightarrow Y\) part of the earlier treatment's effect. Omitting \(L_1\) from an unweighted comparison can leave the \(A_1\)-outcome association confounded. Weighting addresses the latter imbalance while allowing the outcome model to estimate contrasts over treatment histories without conditioning on the affected covariate.
This does not mean that ordinary regression is always unusable. A carefully specified outcome model followed by standardization over the appropriate covariate distributions can also target marginal effects. The problem is treating an adjusted regression coefficient as though it automatically represented a total effect of a treatment history. The estimand and the averaging operation matter.
Weighting is not a guarantee of success. If some treatment histories are very unlikely, their inverse probabilities create large weights and unstable estimates. If important confounders are missing, the weighted treatment groups may remain confounded. If the probability model is inaccurate, the intended balance may not be achieved. The construction clarifies the target comparison, but its credibility depends on the data, assumptions, and models.
- Common mistake: “\(L_1\) predicts \(A_1\) and \(Y\), so I should simply adjust for \(L_1\) in the outcome regression.” That adjustment may control confounding of \(A_1\), but it also conditions on a covariate affected by \(A_0\), potentially removing part of the total effect of \(A_0\).
- Correction: State the treatment-history estimand first. When \(L_1\) is affected by prior treatment, inverse-probability weighting can balance later treatment across measured histories while leaving the outcome comparison marginal over \(L_1\). Causal interpretation still requires appropriate assumptions and adequate weight models.
Check Your Understanding
Use the two-time-point setup to answer the following questions.
- Why can \(L_1\) be both a mediator of the effect of \(A_0\) and a confounder of the effect of \(A_1\)?
- In the hypothetical example, what part of the 7.6-point contrast between histories \((0,0)\) and \((1,0)\) is attributable to the change in the distribution of \(L_1\)?
- For an observation with \(L_1=0\) and \(A_1=1\), what is the second-time unstabilized weight factor? Explain using the stated treatment probability.
- Does weighting make the distribution of \(L_1\) the same for \(A_0=0\) and \(A_0=1\)? Explain which association the second-time weights are designed to address.
- Name two conditions, beyond calculating the weights, that are needed for a causal interpretation of a weighted treatment-history comparison.