One Covariate, Two Causal Roles
In a longitudinal study, a covariate measured after an initial treatment can help determine who receives the next treatment. At the same time, the initial treatment may already have changed that covariate. This creates an important distinction: the covariate is useful for understanding the later treatment decision, but it can also lie on a pathway from the earlier treatment to the outcome.
Use \(L_1\) for baseline covariates, \(A_1\) for treatment at the first visit, \(L_2\) for a covariate measured after \(A_1\) and before the next treatment, \(A_2\) for treatment at the second visit, and \(Y\) for the outcome. The ordering matters. A variable measured after \(A_1\) cannot be a baseline confounder of \(A_1\), but it can be a confounder of the later \(A_2\)-outcome relationship.
The two roles concern different treatment effects. For the effect of \(A_2\), \(L_2\) is measured before the treatment decision and may confound the comparison of people receiving different \(A_2\). For the total effect of \(A_1\), however, \(L_2\) is downstream of the treatment: comparing people at a fixed value of \(L_2\) no longer compares the full consequences of changing \(A_1\). This is why the right adjustment depends on which causal effect is being targeted.
A Small Causal Mechanism
The mechanism can be represented by the arrows \(A_1 \rightarrow L_2 \rightarrow A_2\) and \(L_2 \rightarrow Y\), with \(A_2 \rightarrow Y\) also possible. The first arrow means that changing the initial treatment can change the later covariate. The arrows from \(L_2\) mean that the covariate helps predict both the second treatment and the outcome. A comparison of \(A_2\) groups that ignores \(L_2\) can therefore mix treatment differences with differences in the covariate.
An arrow is a causal claim, not just a correlation. Observing that \(L_2\) is associated with \(A_1\) does not by itself establish that \(A_1\) caused \(L_2\); other causes may explain the association. In a causal analysis, the claim that prior treatment changes \(L_2\) needs an appropriate design or assumptions that support that interpretation.
Worked Example: Prior Treatment Changes Later Treatment Probability
Let \(A_1\) be randomized with \(P(A_1=1)=0.5\). Let \(U\sim\operatorname{Bernoulli}(0.4)\), independent of \(A_1\), and define \(L_2=\max(A_1,U)\). Suppose the second treatment is assigned with \(P(A_2=1\mid L_2=0)=0.2\) and \(P(A_2=1\mid L_2=1)=0.8\).
Under \(A_1=0\), \(L_2=U\), so \(P(L_2=1\mid A_1=0)=0.4\). Under \(A_1=1\), \(L_2=1\) for either value of \(U\), so \(P(L_2=1\mid A_1=1)=1\). Thus the probability of \(L_2=1\) increases by \(1-0.4=0.6\) when \(A_1\) changes from 0 to 1.
The probability of \(A_2=1\) under \(A_1=0\) is \(0.4(0.8)+0.6(0.2)=0.32+0.12=0.44\). Under \(A_1=1\), \(L_2=1\) with probability 1, so \(P(A_2=1\mid A_1=1)=0.8\). The earlier treatment changes the later treatment probability through its effect on \(L_2\). Here \(L_2\) predicts \(A_2\), and its distribution depends on \(A_1\).
Why the Causal Target Must Be Clear
A causal mean under a treatment regime is not automatically the observed conditional mean among people who happened to receive that treatment. To make the distinction precise, let \(Y(a_1,a_2)\) denote the outcome if treatment were set to \(a_1\) at the first visit and to \(a_2\) at the second. The covariate under the first intervention is denoted \(L_2(a_1)\); it can change when \(a_1\) changes.
One standard identification route uses consistency, no interference between study units, sequential exchangeability, and positivity. Consistency means that observed covariates and outcomes equal their corresponding potential values under the treatment history actually received. Sequential exchangeability requires that, conditional on measured history, treatment assignment is independent of the relevant future potential outcomes and covariates: at the first visit, conditional on \(L_1\), for \(A_1\); and at the second visit, conditional on \(L_1,A_1,L_2\), for \(A_2\). Positivity requires positive probability of each treatment level being considered at histories that occur under the regime. These are substantive assumptions, not consequences of a fitted regression model.
For discrete covariates, these assumptions identify the mean under the fixed regime \((a_1,a_2)\) by the longitudinal g-formula:
For continuous covariates, the sums are replaced by integrals. Crucially, the formula averages the outcome response over the distribution of \(L_2\) that follows \(A_1=a_1\). It does not hold \(L_2\) to a common distribution across the two initial-treatment regimes.
To see why the formula follows, first condition the intervention mean on baseline covariates and the covariate that would follow \(a_1\):
By first-visit exchangeability and consistency, the distribution of \(L_2(a_1)\) conditional on \(L_1=l_1\) equals \(P(L_2=l_2\mid L_1=l_1,A_1=a_1)\). By second-visit exchangeability, conditional on the measured history, the response mean under \(A_2=a_2\) equals the observed conditional mean among those with \(A_2=a_2\); consistency links that observed outcome to the potential outcome. Positivity ensures the required conditional groups are represented. Substituting these two observed-data expressions gives the formula. \(\square\)
This argument also shows what would be missing if one simply equated \(E[Y\mid A_1,L_2,A_2]\) with a causal response mean. If an unmeasured cause influences both treatment and outcome, the observed conditional mean can differ from the mean under intervention. Consistency alone does not remove that confounding.
Worked Example: The Initial Treatment Changes the Covariate Distribution
Suppose \(P(L_2=1\mid do(A_1=0))=0.3\) and \(P(L_2=1\mid do(A_1=1))=0.7\). Let the conditional outcome response means under interventions on both treatments be 10 and 16 when \(A_2=0\) and \(L_2\) is 0 or 1, respectively; when \(A_2=1\), let those means be 12 and 18. Assume the sequential exchangeability and positivity conditions just described, so these response means and covariate distributions are identified from the observed data.
Under the regime \((A_1=0,A_2=0)\), the g-formula gives \(0.7(10)+0.3(16)=7+4.8=11.8\). Under \((A_1=1,A_2=0)\), it gives \(0.3(10)+0.7(16)=3+11.2=14.2\). The difference is \(14.2-11.8=2.4\), even though the conditional response means shown here have no direct \(A_1\) difference at a fixed \(L_2,A_2\). The change arises because \(A_1\) changes the distribution of \(L_2\).
If \(P(A_2=1\mid L_2=0)=0.2\) and \(P(A_2=1\mid L_2=1)=0.8\), then \(L_2\) also predicts subsequent treatment. The marginal probabilities of \(A_2=1\) under the two initial-treatment regimes are \(0.7(0.2)+0.3(0.8)=0.38\) and \(0.3(0.2)+0.7(0.8)=0.62\). In this example, the same \(L_2\) both carries part of the earlier treatment’s effect and helps explain the later treatment decision.
What Adjustment Does—and Does Not—Answer
For estimating the effect of the second treatment, comparing people with similar \(L_1,A_1,L_2\) can address confounding of \(A_2\), provided the assumptions for causal identification are credible. But for the total effect of \(A_1\), conditioning on \(L_2\) changes the comparison: the analysis no longer averages over the different \(L_2\) distributions induced by the two initial treatments. It may therefore exclude part of the pathway through \(L_2\). This is not a rule that \(L_2\) must never be adjusted for; it is a warning to define the target effect before choosing the adjustment.
| Analysis choice | What it can address | Key caution |
|---|---|---|
| Adjust for baseline \(L_1\) only | Confounding associated with measured baseline covariates | Does not account for \(L_2\) as a confounder of the \(A_2\)-outcome relationship |
| Condition on \(L_2\) in an outcome regression | Can compare \(A_2\) levels at measured histories | For an \(A_1\) total effect, this can change the target by holding a treatment-affected covariate fixed |
| Use a longitudinal g-formula | Averages response means over covariate distributions under specified treatment regimes | Requires correct models and the causal identification assumptions |
| Use a marginal structural model approach | Can target marginal effects while addressing time-varying confounding | Does not eliminate the need for exchangeability, positivity, and appropriate specification |
The g-formula and marginal structural models are alternatives to a single regression that conditions on every measured covariate in the same way. Neither approach repairs unmeasured confounding or unsupported treatment histories. Their usefulness depends on the question, the assumptions, and the data.
Diagnostics and Common Pitfalls
Before treating \(L_2\) as treatment-affected, check the measurement order and the substantive mechanism: was \(L_2\) measured after \(A_1\), and is there a credible reason \(A_1\) could change it? Then check whether \(L_2\) predicts \(A_2\) and the outcome after accounting for relevant measured history. Prediction alone does not prove confounding, but a strong relationship can signal that an unadjusted later-treatment comparison is risky.
- Adjusting mechanically for every covariate. A post-treatment variable does not play the same role as a baseline confounder. Specify the treatment effect being targeted before deciding how to handle it.
- Assuming a conditional regression mean is causal. A regression model describes observed data unless causal assumptions connect it to interventions. In particular, unmeasured confounding can break that connection.
- Ignoring positivity. If some histories almost always receive one treatment level, comparisons at those histories rely on little data or extrapolation. Inspect treatment frequencies across covariate histories.
- Confusing prediction with causal change. An association between \(A_1\) and \(L_2\) may reflect common causes. The claim that \(A_1\) changes \(L_2\) needs a causal justification.
Even with careful adjustment, estimates can be sensitive to measurement error in \(L_2\), misspecified response or covariate models, limited overlap, and unmeasured causes of treatment and outcome. A good analysis reports these limitations rather than treating adjustment as an automatic guarantee.
Check Your Understanding
Answer each question, then compare with the brief solutions.
- If \(A_1\) occurs before \(L_2\), can \(L_2\) be a baseline confounder of \(A_1\)? What role might it have for \(A_2\)?
- Suppose \(P(L_2=1\mid do(A_1=0))=0.2\) and \(P(L_2=1\mid do(A_1=1))=0.6\). By how much does the probability of \(L_2=1\) change?
- In the second worked example, why do the two \(A_2=0\) regime means differ despite equal conditional response means at each fixed \(L_2\)?
- What assumptions, beyond consistency, are needed to use the observed conditional mean to identify a causal response mean?
Solutions. (1) No: it occurs after \(A_1\), so it cannot be a baseline confounder of that earlier treatment. It may confound the later \(A_2\)-outcome comparison because it precedes \(A_2\) and can predict treatment and outcome. (2) The increase is \(0.6-0.2=0.4\). (3) The regime-specific means average the same conditional responses over different \(L_2\) distributions, giving \(11.8\) versus \(14.2\). (4) Sequential exchangeability and positivity, along with consistency and no interference, are standard conditions; without adequate control of treatment-outcome confounding, the observed conditional mean need not equal the intervention response mean.