Why a Longitudinal Treatment Weight Has One Factor Per Decision
In a longitudinal study, treatment may be assigned repeatedly, while a time-varying covariate can both predict later treatment and be affected by earlier treatment. Comparing people with different treatment histories can therefore mix treatment effects with differences in their evolving histories. The longitudinal treatment weight is constructed to counter the treatment-selection mechanism at each decision, rather than trying to adjust for the entire history with a single baseline comparison.
The construction follows directly from the factorization of the observed-data distribution. At each visit, the probability of the treatment actually received, conditional on the measured history available just before that decision, contributes one factor. Weighting by the reciprocal of every such factor cancels the treatment-assignment part of the factorization.
The denominator is evaluated at the individual’s observed treatment and history at each time. Thus the weight is a single number for the observed trajectory, not a probability of the whole treatment history calculated without regard to covariates. This tutorial concerns the denominator-only, or unstabilized, treatment weight; each factor is an inverse conditional treatment probability.
Factorizing the Longitudinal Data Distribution
Suppose \(L_0\) is measured before \(A_0\), \(L_t\) for \(t=1,\ldots,K\) is measured after the preceding treatment and before \(A_t\), and the outcome \(Y\) is observed after \(A_K\). The chain rule gives the following factorization, with each covariate transition and treatment mechanism represented once:
The first product starts at \(t=1\), since \(p(l_0)\) is already written separately. The treatment product starts at \(t=0\), because the first treatment is assigned after baseline covariates are measured. The factor \(p(y\mid\bar l_K,\bar a_K)\) describes the observed outcome distribution; it is not part of the treatment weight.
Multiplying the observed-data density by the weight replaces every treatment mechanism factor with one:
This is the key algebraic cancellation. At a particular treatment decision, conditional on the prior treatment history, the inverse-probability factor removes dependence of that treatment decision on the measured covariate history that appears in its denominator. For binary treatment, the reweighted contributions for \(A_t=0\) and \(A_t=1\) are each proportional to one, so after normalizing over those two options each has probability \(1/2\). For a treatment with \(m\) discrete options, the corresponding contributions are equal and normalize to \(1/m\), where all options have positive probability.
The resulting pseudo-population is a weighted representation, not a new randomized sample. The cancellation describes the treatment assignment mechanism relative to measured history. Covariates can still depend on prior treatment: for example, \(L_t\) may have a different distribution under different values of \(A_{t-1}\). Weighting at time \(t\) balances the measured history for the current decision within prior treatment history; it does not erase the consequences of earlier treatment.
Worked Example: Computing a Three-Decision Treatment Weight
Consider a hypothetical person observed at three treatment decisions, \(t=0,1,2\). Given this person’s history at each decision, suppose the probability of the treatment actually received is \(0.80\), \(0.30\), and \(0.75\), respectively. These are illustrative conditional probabilities, not estimates from a real study.
The weight is the product of the three reciprocal probabilities:
This person represents about 5.556 weighted observations in a calculation using these weights. The large contribution arises because the observed sequence includes treatment decisions that, given the person’s measured histories, had relatively low probabilities. It does not mean the person was literally observed 5.556 times, and it does not by itself establish a causal effect.
Assumptions Behind the Causal Use of the Weight
The arithmetic definition of a weight requires treatment probabilities, but interpreting weighted comparisons causally requires additional assumptions. For a specified treatment history, the standard conditions are:
- Consistency: when a person’s observed treatment history equals a specified history, the observed outcome equals that person’s potential outcome under that history.
- Sequential exchangeability: at each decision time, conditional on \(H_t\), the treatment \(A_t\) is independent of the potential outcomes under the treatment histories being considered. In words, the measured history is sufficient to control confounding of that treatment decision for those outcomes.
- Positivity: every treatment option under consideration has positive conditional probability for histories that occur in the target population. For binary treatment, this requires \(0<P(A_t=1\mid H_t)<1\) at relevant histories.
The treatment mechanism must also be known or estimated adequately for the intended analysis. If a relevant confounder is unmeasured, or a treatment probability is incorrectly specified, the algebraic cancellation does not guarantee that the weighted data are free of confounding. Positivity matters directly to the formula: a zero denominator makes a weight undefined, and probabilities near zero produce large weights.
Under consistency, sequential exchangeability, and positivity, the cancellation supports identification of a regime-specific mean. For a discrete treatment history \(\bar a_K\), let \(I(\bar A_K=\bar a_K)\) equal one when the observed history matches \(\bar a_K\), and zero otherwise. Then the weighted observed mean contribution for that history has expectation equal to the mean potential outcome under that history:
To see why, restrict the factorized density to \(\bar A_K=\bar a_K\). On that restricted set, multiplying by \(W^A_K\) cancels the conditional treatment probabilities. Integrating over the covariate histories and outcome leaves the covariate transitions generated along \(\bar a_K\) and the corresponding outcome distribution. Consistency connects the observed outcome for people with that history to their potential outcome under it; sequential exchangeability allows the conditional observed outcome distributions along the history to stand in for the relevant potential-outcome distributions. Positivity ensures those conditional treatment factors can be canceled. This is the same sequence of covariate-history averages that defines the mean under the specified intervention.
This expectation identity is stated for the unnormalized weighted contribution. The total weight assigned to a treatment-history group need not be the same as the group’s unweighted size. In practice, a weighted mean within a treatment-history group divides its weighted outcome total by its weighted group total. The identity explains the target of that comparison; it does not remove the need to estimate the treatment mechanisms or assess the assumptions.
Worked Example: Cancellation Balances a Baseline Confounder
Suppose a hypothetical population has a binary baseline covariate \(X\), with \(P(X=1)=0.40\). Treatment is binary, and the treatment probabilities are \(P(A=1\mid X=1)=0.80\) and \(P(A=1\mid X=0)=0.20\). Thus \(X\) strongly predicts treatment. Consider the expected weighted mass in each \(X\) group within each treatment group.
Among treated people with \(X=1\), the population mass before weighting is \(0.40(0.80)=0.32\). Their treatment weight is \(1/0.80=1.25\), so their weighted mass is \(0.32(1.25)=0.40\). Among treated people with \(X=0\), the mass is \(0.60(0.20)=0.12\), and the weight is \(1/0.20=5\), giving weighted mass \(0.12(5)=0.60\).
For untreated people with \(X=1\), the mass is \(0.40(0.20)=0.08\), and the weight is \(1/0.20=5\), giving weighted mass \(0.08(5)=0.40\). For untreated people with \(X=0\), the mass is \(0.60(0.80)=0.48\), and the weight is \(1/0.80=1.25\), giving weighted mass \(0.48(1.25)=0.60\).
Both weighted treatment groups have the same covariate proportions: 40% with \(X=1\) and 60% with \(X=0\), matching the population distribution. The arithmetic works because, within each \(X\) stratum, the probability of receiving the observed treatment cancels its reciprocal weight. This is a population calculation; a finite sample need not exhibit exact balance.
Time-Varying Confounding and Conditional Balance
The same cancellation applies at later decisions, where the history includes previous treatment and time-varying covariates. The important qualification is that balance is conditional on prior treatment history. A time-varying covariate affected by earlier treatment may still differ across earlier treatment histories, as it should.
Worked Example: Balancing a Time-Varying Confounder at the Second Decision
Consider a hypothetical subgroup with \(A_0=1\). Suppose \(L_1\) is affected by \(A_0\), and within this subgroup \(P(L_1=1\mid A_0=1)=0.70\). At the next decision, treatment probabilities depend on \(L_1\): \(P(A_1=1\mid A_0=1,L_1=1)=0.90\) and \(P(A_1=1\mid A_0=1,L_1=0)=0.30\). The corresponding probabilities of \(A_1=0\) are \(0.10\) and \(0.70\).
For people with \(A_0=1,L_1=1,A_1=1\), the conditional covariate mass times the second-decision weight is \(0.70(0.90)(1/0.90)=0.70\). For \(L_1=0,A_1=1\), it is \(0.30(0.30)(1/0.30)=0.30\). Thus the total weighted mass for \(A_1=1\), conditional on \(A_0=1\), is \(1.00\).
For \(A_1=0\), the corresponding calculations are \(0.70(0.10)(1/0.10)=0.70\) for \(L_1=1\) and \(0.30(0.70)(1/0.70)=0.30\) for \(L_1=0\). The total is again \(1.00\). Therefore, in both second-decision treatment groups, the weighted proportions of \(L_1=1\) and \(L_1=0\) are \(0.70\) and \(0.30\).
The first-decision weight is constant within the subgroup \(A_0=1\), so it does not change this comparison. The calculation shows that weighting removes the association between \(A_1\) and measured \(L_1\), conditional on \(A_0\), in the weighted representation. It does not claim that \(L_1\) is independent of \(A_0\), nor should it: \(L_1\) may be a consequence of \(A_0\).
Common Mistakes and a Practical Check
- Using one probability for the whole sequence. The relevant probability at each visit is conditional on that visit’s measured history and prior treatments. The joint treatment probability factors into all these conditional probabilities, so the inverse weight needs one reciprocal per decision.
- Including baseline covariates twice in a factorization. If \(p(l_0)\) is written outside the covariate-transition product, that product must start at \(t=1\). Otherwise the baseline density is counted twice.
- Claiming that weighting erases every relationship between treatment and covariates. It removes the measured-history component of the current treatment assignment mechanism, conditional on prior treatment. Earlier treatment may still affect later covariates.
- Treating cancellation as proof that confounding is solved. Cancellation is algebraic, but causal interpretation still depends on consistency, sequential exchangeability, positivity, and adequate treatment-probability models.
- Rounding each reciprocal too early. Multiply using unrounded probabilities or enough digits, then round the final weight. Displayed rounded factors can otherwise fail to reproduce the displayed product.
Check Your Understanding
Use the definitions and calculations above to answer these questions.
- For decisions at times \(0,1,2\), what factors appear in the unstabilized treatment weight for a person’s observed history?
- In the joint factorization, why does the covariate-transition product begin at \(t=1\) when \(p(l_0)\) is written separately?
- Suppose the probabilities of the observed treatments at two visits are \(0.50\) and \(0.25\). Calculate the treatment weight and explain what it represents.
- In a longitudinal setting, what does the second-decision weight balance, and why should it not be interpreted as removing the effect of the first treatment on a later covariate?
- Name the three main causal assumptions needed to interpret a weighted treatment-history comparison causally.