Why Compare Policies Using the Same Population?
A treatment policy specifies what treatment to assign at each point in time, using information available at that point. One policy might assign treatment at both visits to everyone. Another might assign the first treatment to everyone, then use an intermediate health measure to decide who receives treatment at the second visit. Comparing these policies asks a practical question: what average outcome would the same target population have under each policy?
The comparison requires more than contrasting outcomes among people who happened to follow different treatment histories. The histories may differ in their covariates and prognosis. Instead, g-computation uses sequential models to predict outcomes under each policy, averages those predictions over the covariate histories that would arise under that policy, and then averages over a common baseline target population.
Setup: Two Visits and One Intermediate Covariate
Consider two treatment times. Let \(A_1\) and \(A_2\) denote treatment at the first and second visits, with values 0 or 1. Let \(X\) be a baseline covariate, and let \(L_1\) be a binary covariate measured after the first treatment but before the second. Let \(Y\) be a continuous outcome measured after the second treatment. In the example, \(Y\) is symptom burden in points, so lower values are better.
We will compare two policies. The sustained policy assigns \(A_1=1\) and \(A_2=1\) to everyone. The adaptive policy assigns \(A_1=1\) to everyone, then assigns \(A_2=L_1\): people with \(L_1=1\) receive the second treatment, while those with \(L_1=0\) do not. Both policies begin with the same first treatment. Their later assignments differ for people with \(L_1=0\).
The fitted models in this hypothetical example are deliberately simple. The first models the intermediate covariate under the first treatment:
The second is the conditional outcome-mean model:
For this calculation, the target population has equal proportions with \(X=0\) and \(X=1\). The conditional mean model is used to predict \(Y\) at each covariate and treatment history specified by a policy. The model for \(L_1\) supplies the probabilities used to average over the intermediate histories.
Worked Example: Constructing the Intermediate-History Distribution
Worked Example: Constructing the Intermediate-History Distribution
Suppose the target population contains 1,000 people: 500 with \(X=0\) and 500 with \(X=1\). Under either policy, \(A_1=1\). Use the fitted covariate model to find the expected numbers with each value of \(L_1\) in each baseline group.
For \(X=0\), the model gives \(P(L_1=1\mid X=0,A_1=1)=0.40\). Thus the expected number with \(L_1=1\) is \(500(0.40)=200\), and the expected number with \(L_1=0\) is \(500(1-0.40)=300\).
For \(X=1\), the corresponding probability is 0.70. The expected numbers are \(500(0.70)=350\) with \(L_1=1\) and \(500(1-0.70)=150\) with \(L_1=0\).
These are model-implied expected counts, not a claim that an actual sample must contain exactly those counts. The overall target-population probability of \(L_1=1\), under the common first treatment, is
This distribution is needed for both policies because they have the same first treatment and baseline target population. The policies will use different second treatments for some histories, but neither changes the already measured \(L_1\).
Worked Example: Mean Under the Sustained Policy
Worked Example: Mean Under the Sustained Policy
Under the sustained policy, both treatments equal 1 for every person. First substitute \(A_1=1\) and \(A_2=1\) into the outcome model. For \(X=0\), the predicted mean is 16 when \(L_1=0\) and 19 when \(L_1=1\). For \(X=1\), the corresponding predictions are 18 and 21.
Average these predictions over the intermediate-covariate probabilities within each baseline group. For \(X=0\):
For \(X=1\):
Finally, average over the same target population's baseline distribution, which assigns probability 0.50 to each value of \(X\):
Under the assumptions stated above and the fitted models used here, the sustained policy's estimated counterfactual mean symptom burden is 18.65 points in this target population.
Worked Example: Mean Under the Adaptive Policy and the Contrast
Worked Example: Mean Under the Adaptive Policy
Now assign \(A_1=1\) to everyone and set \(A_2=L_1\). The second treatment is therefore 0 when \(L_1=0\), and 1 when \(L_1=1\). Substituting those assignments into the same outcome model gives the following predicted means: for \(X=0\), 12 at \(L_1=0\) and 19 at \(L_1=1\); for \(X=1\), 14 at \(L_1=0\) and 21 at \(L_1=1\).
For \(X=0\), average over the model-implied \(L_1\) distribution:
For \(X=1\):
Standardize to the same 50:50 baseline distribution:
Define the contrast as sustained minus adaptive. Then
Because higher symptom burden is worse, the model-based comparison favors the adaptive policy by 1.80 points on average in this hypothetical target population. This is a contrast of two counterfactual means, not the difference between observed groups who happened to receive the two treatment histories.
Why the Averaging Step Matters
For either policy, the g-formula calculation can be written as an average over baseline covariates and then over the intermediate covariate values that would arise under its first treatment. In this example, both policies set \(A_1=1\), so they use the same probabilities for \(L_1\). Their outcome predictions differ because the adaptive policy's second treatment depends on \(L_1\).
Here \(g_2(x,l_1)\) denotes the second treatment assigned by policy \(g\) at that history. For the sustained policy it equals 1 for both values of \(L_1\); for the adaptive policy it equals \(l_1\). The formula makes two features of the comparison explicit: the policy determines which outcome prediction to use at each history, and the history probabilities determine how much weight that prediction receives. The final outer average uses the target population's baseline distribution for both policies.
A short check on the contrast is possible from the model itself. The policies differ only when \(L_1=0\). In that history, the sustained policy uses \(A_2=1\), while the adaptive policy uses \(A_2=0\). The outcome model assigns a difference of 4 points to this change in \(A_2\), regardless of \(X\) or \(L_1\). The target-population probability of \(L_1=0\) is \(1-0.55=0.45\). Therefore:
This agrees with the direct standardization. It is a check specific to this additive model: with treatment interactions or a different outcome model, the treatment contrast could vary across histories, and the full weighted calculation would be needed.
Common Mistake: Comparing Observed Treatment Histories
A tempting but incorrect shortcut is to compare the observed mean outcome among people who received treatment at both visits with the observed mean among people who received the adaptive pattern. Those groups need not have the same distribution of \(X\) or \(L_1\). In particular, \(L_1\) is measured after the first treatment and may be related to prognosis; it also determines the adaptive policy's second treatment. The crude observed-group difference therefore need not equal the policy contrast.
G-computation instead applies the fitted models to each target-population history and averages according to the history distribution under the policy being evaluated. This distinction also explains why simply inserting the policy's treatment values into an outcome model and averaging without accounting for \(L_1\) is incomplete: the policy mean must include the possible covariate histories and their probabilities.
Check Your Understanding
Use the models and target population in the examples to answer the following.
- Under the sustained policy, what outcome-model prediction is used for a person with \(X=1\) and \(L_1=0\)? Show the treatment values substituted.
- Why does the adaptive policy use the same \(L_1\) probabilities as the sustained policy in this example?
- Write the adaptive policy's second-treatment rule in terms of \(L_1\), and state what treatment it assigns when \(L_1=0\).
- Interpret the 1.80-point contrast in context, including which policy has the lower predicted mean symptom burden.
- Why would comparing observed people with different treatment histories not, by itself, establish the counterfactual policy contrast?