From Conditional Models to a Regime-Specific Mean
A longitudinal treatment policy can change more than the treatment received at each visit. Earlier treatment may alter a later covariate, and that covariate may in turn predict the outcome and affect later treatment decisions. To estimate the mean outcome under a specified policy, the analysis must account for the covariate histories that would arise under that policy—not simply hold each person's observed covariates fixed.
The parametric g-formula does this by combining sequential models for covariates with a conditional model for the outcome. It sets treatment values according to a regime, propagates the covariate distribution under those assigned values, predicts outcomes for the resulting histories, and averages those predictions over a target population.
For a fixed number \(K\) of treatment occasions, the covariates observed before the last treatment are \(L_0,\ldots,L_{K-1}\), and the treatments are \(A_0,\ldots,A_{K-1}\). Write \(m(\bar l_{K-1},\bar a_{K-1})\) for the conditional mean of \(Y\) given those covariate and treatment histories. Write \(f_t(l_{t+1}\mid \bar l_t,\bar a_t)\) for the conditional distribution of the next covariate. Under regime \(d\), the g-formula is
Here \(F_{L_0}^{*}\) is the baseline covariate distribution in the target population. The notation \(\bar d_t(\bar l)\) means that the regime's treatment rule is applied at each time using the covariate history available then. For discrete covariates, the integrals over their values are sums. For continuous covariates, they are integrals. The covariate-transition factors describe how later covariates are distributed under the assigned earlier treatments; they are not treatment-assignment probabilities.
What Must Be Modeled—and What Is Set by the Regime
The formula has two distinct modeling tasks. First, specify a conditional distribution for each covariate that evolves after treatment. Second, specify the conditional mean of the final outcome given the relevant history. The regime supplies the treatment values in these models. Thus, treatment is set to the policy value, while covariate histories are allowed to vary according to the modeled consequences of earlier treatment.
| Component | Role in the formula | What happens under regime \(d\) |
|---|---|---|
| Baseline distribution \(F_{L_0}^{*}\) | Represents the target population at baseline | Average over its covariate distribution |
| Covariate model \(f_t\) | Describes the next covariate given the history so far | Evaluate it at the treatments assigned by \(d\) |
| Outcome model \(m\) | Predicts the conditional mean of \(Y\) given the full history | Evaluate it at the regime-assigned treatment history |
| Treatment assignment mechanism | Describes treatment choices in the observed data | Not multiplied into this intervention formula |
A dynamic regime can use the current covariate history—for example, assign a higher dose if a measured symptom score exceeds a threshold. In that case, the assigned treatment at a later visit can differ across the covariate histories generated by the transition models. A static regime instead specifies the same treatment at a given occasion regardless of that history. In either case, treatment values in the conditional models are replaced according to the rule; the covariates are not replaced by fixed observed values.
Worked Example: Reading the Components in a Two-Visit Study
Suppose \(L_0\) is a baseline risk score, \(A_0\) is an initial treatment, \(L_1\) is a symptom score measured afterward, \(A_1\) is a second treatment, and \(Y\) is a health score after the second treatment. A regime specifies \(A_0=d_0(L_0)\) and \(A_1=d_1(L_0,L_1)\). Identify the models needed for its g-formula.
The baseline component is the target distribution of \(L_0\). The sequential covariate model is the distribution of \(L_1\) given \(L_0\) and \(A_0\), written \(f_0(l_1\mid l_0,a_0)\). The conditional outcome model is \(m(l_0,l_1,a_0,a_1)=E(Y\mid L_0=l_0,L_1=l_1,A_0=a_0,A_1=a_1)\).
For each baseline value, the rule first sets \(a_0=d_0(l_0)\). The covariate model is evaluated at that value to represent the symptom scores that could follow the initial treatment. For each resulting symptom score, the rule sets \(a_1=d_1(l_0,l_1)\), and the outcome model predicts the conditional mean. The formula averages those predictions over the symptom-score distribution and then over the target distribution of \(L_0\). This identifies the parts of the calculation without treating the observed symptom score as if it could not change under another initial treatment.
Identification and the Parametric Assumptions
The g-formula is not causal merely because conditional models have been written down. Its causal interpretation relies on the longitudinal identification conditions established for regime-specific counterfactual outcomes. In brief, consistency connects observed outcomes to the counterfactual outcomes for the treatment history actually received; sequential exchangeability rules out unmeasured confounding of each treatment decision given the measured history; and positivity requires support for the treatments the regime assigns within relevant histories. These conditions concern the study and the target regime, not just the quality of a regression fit.
The parametric version adds a modeling requirement: the chosen conditional models must adequately represent the covariate transition distributions and the conditional outcome mean over the histories used by the regime. If a model is misspecified, the resulting plug-in mean can be wrong even when the causal identification conditions hold. Positivity also matters practically: a model's numerical ability to produce a prediction does not establish that the corresponding treatment-history combinations are supported by the data.
The basic justification is iterated expectation. Under the regime, first condition on baseline covariates and the subsequent covariate history. The conditional mean of the outcome is then averaged over the regime-specific distribution of that history. Sequential exchangeability and consistency allow the conditional quantities in this counterfactual expectation to be represented by the corresponding observed-data conditional models evaluated at regime-assigned treatments. Applying the law of total expectation successively gives the product of covariate transition distributions in the formula.
The first line is an expectation over the covariate history that would occur under the regime. The second line expresses that expectation using the observed conditional outcome and covariate models, with the regime's treatments substituted. This is why the covariate models are essential: they determine the distribution over which outcome predictions are averaged.
Worked Calculations
Worked Example: Substituting a Regime into an Outcome Model
For illustration, suppose a fitted conditional mean model for a health score, measured in points, is
where \(x\) is baseline age in decades above 40, \(l\) is the symptom score, and \(z_t\) indicates receipt of a 10-mg dose at visit \(t\) (zero indicates no dose). Consider the history \(x=2\), \(l=8\), under a regime assigning a 10-mg dose at both visits. The regime therefore gives \(z_0=1\) and \(z_1=1\). Substitution gives
The model predicts a conditional mean health score of 52 points for this specified history under the assigned treatments. This is one prediction, not yet the regime-specific population mean: the g-formula must also average over the symptom histories generated under the initial treatment and over the target population's baseline ages.
Worked Example: Averaging Over a Regime-Specific Covariate Distribution
Consider a simplified target population in which every person has the same baseline covariates. Under the first treatment assigned by a regime, suppose the modeled probabilities for the later symptom category are 0.20 for low, 0.50 for medium, and 0.30 for high. These probabilities sum to \(0.20+0.50+0.30=1.00\). Suppose the regime assigns the same second treatment for each category, and the outcome model predicts conditional means of 40, 50, and 60 points for low, medium, and high symptoms, respectively.
The regime-specific mean is the outcome prediction averaged using the covariate distribution under the regime:
The weights are not the proportions of symptom categories among people who happened to receive a particular observed treatment. They are the conditional probabilities from the covariate model evaluated at the regime-assigned earlier treatment. If that earlier treatment changes the symptom distribution, the weights—and therefore the regime-specific mean—can change.
Worked Example: Standardizing Across Baseline Strata
Now suppose the target population has two baseline strata, \(X=0\) and \(X=1\), each containing half the population. Under the specified regime, the covariate model gives low, medium, and high symptom probabilities of \((0.20,0.50,0.30)\) for \(X=0\), and \((0.40,0.40,0.20)\) for \(X=1\). Each row sums to one. The outcome model's conditional mean predictions under the regime are \((40,50,60)\) points for \(X=0\) and \((44,54,64)\) points for \(X=1\), in the same symptom-category order.
Within the \(X=0\) stratum, the averaged prediction is
Within the \(X=1\) stratum, it is
Finally, average those stratum-specific means using the target population weights:
Thus, the model-based mean outcome under this regime for this target population is 51.5 points. A different target population with different baseline-stratum weights could have a different regime-specific mean, even if the conditional models were unchanged.
Common Mistake: Holding Later Covariates Fixed
A tempting shortcut is to set treatment to the regime value in an outcome regression while leaving each person's later covariate at its observed value, then average the predictions. That calculation generally does not implement the g-formula. A later covariate may itself be affected by earlier treatment, so its observed value need not represent the covariate value that would arise under the intervention. The correction is to use the covariate transition model to obtain the distribution of later covariates under the regime, and average outcome predictions over that distribution.
A second error is to multiply by the observed treatment probabilities as if the goal were to reproduce the natural treatment-assignment process. The intervention formula replaces treatment assignment with the regime; its sequential probability factors describe covariate evolution, not the probability that people receive the assigned treatment. This distinction is central to interpreting the formula.
State the baseline population and the treatment rule at each occasion, including any covariates the rule uses.
Use a model for each post-treatment covariate transition and a conditional mean model for the final outcome.
Evaluate the transition and outcome models at treatment values specified by the regime for each history.
Integrate or sum over the covariate histories generated under the regime, then average over the target baseline distribution.
Check Your Understanding
Use the definitions and calculations above to answer these questions.
- In a two-treatment-occasion study, which conditional distribution determines the modeled distribution of the covariate measured between the treatments?
- Why does a regime-specific mean require averaging over later covariates rather than simply fixing each later covariate at its observed value?
- If a dynamic rule assigns treatment using the current symptom score, at what stage is that rule applied in the g-formula?
- In the second worked calculation, what does the weight 0.30 represent, and why is it not an observed treatment probability?
- Name the causal identification conditions and the additional parametric modeling requirement needed for a causal interpretation of the parametric g-formula.