From Longitudinal Histories to a Product
With repeated treatment decisions, later covariates can be affected by earlier treatment and can in turn inform later treatment. A regime-specific outcome distribution must account for the covariate histories that would arise under the regime. The product G-formula does this by multiplying the conditional distributions of those covariates by the conditional outcome distribution, then summing over covariate histories.
Consider \(K\) treatment times, indexed \(t=0,\ldots,K-1\). Let \(L_0\) be baseline covariates. At time \(t\), the measured covariate history is followed by treatment \(A_t\); after treatment \(A_t\), the next covariate \(L_{t+1}\) is measured. The outcome \(Y\) is measured after the final treatment, \(A_{K-1}\), and the final covariate, \(L_K\). Write \(\bar L_t=(L_0,\ldots,L_t)\) and \(\bar A_t=(A_0,\ldots,A_t)\). Thus, just before \(A_t\), the observed history is \(H_t=(\bar L_t,\bar A_{t-1})\), with \(\bar A_{-1}\) empty.
A regime \(g\) specifies a treatment rule \(g_t\) at each time \(t\). The rule may prescribe the same treatment for everyone (a static regime) or select treatment according to the history available at that time (a dynamic regime). Under a dynamic regime, earlier prescribed treatments are themselves determined by the covariate history.
For a discrete-time setting with discrete covariates, the product formula sums over every possible covariate path. It includes a baseline covariate distribution, a conditional distribution for each later covariate, and a final conditional outcome distribution. The treatment values used in each conditional distribution are those dictated by the regime along that path.
Here, \(p(l_0)\) is the baseline covariate distribution. In the factor for \(L_t\), the treatment history runs only through \(A_{t-1}\), because \(L_t\) is measured before \(A_t\). The outcome factor conditions on all covariates through \(L_K\) and all treatments through \(A_{K-1}\). The sum ranges over the support of every covariate in the path. The conditional probabilities are observed-data probabilities evaluated at the treatment values specified by \(g\).
Why the Formula Has These Factors
The assumptions explain why the counterfactual distribution can be represented using observed conditional distributions. Consistency means that, for a person whose observed treatment history follows the regime, the observed covariates and outcome agree with the corresponding counterfactual values under that regime. Sequential exchangeability requires that, at each treatment time and among individuals with the same measured history \(H_t\), treatment assignment be independent of the future counterfactual covariates and outcome under the treatment continuations of interest. This rules out unmeasured confounding at each treatment decision, conditional on the recorded history.
Positivity requires that each treatment value prescribed by the regime have positive probability among individuals with histories that can occur under that regime. For a dynamic rule, this requirement applies to the value selected by the rule at each such history. If a prescribed treatment never occurs for a relevant history, the observed data do not supply the conditional distribution needed at that point.
A short factorization argument shows the structure of the result. Under the intervention, the joint distribution of the covariate path and outcome can be written as a baseline distribution, successive covariate distributions given prior history and assigned treatments, and an outcome distribution given the completed history:
This is the chain rule applied to the sequence of covariates and the outcome under the intervention. Consistency and sequential exchangeability allow each conditional distribution in this factorization to be replaced by the corresponding observed-data conditional distribution at the assigned treatment history. Positivity ensures those conditional distributions are supported by the data. Summing the resulting joint distribution over all covariate paths gives the displayed formula for \(P(Y^g=y)\).
There is no treatment-assignment probability factor in this product. Under \(g\), treatment is set by the rule rather than drawn from its observed conditional distribution. By contrast, the covariate factors remain distributions: the intervention does not set covariates to particular values, so their possible paths must be represented and summed over.
Worked Applications
Worked Example: One Treatment and a Binary Covariate
Suppose \(K=1\), so \(L_0\) is baseline, \(A_0\) is assigned, \(L_1\) follows, and then \(Y\) is measured. Consider the static regime \(g_0=1\). Assume the following hypothetical conditional probabilities:
- \(P(L_0=1)=0.40\), hence \(P(L_0=0)=0.60\).
- \(P(L_1=1\mid L_0=0,A_0=1)=0.30\) and \(P(L_1=1\mid L_0=1,A_0=1)=0.60\).
- Under \(A_0=1\), the outcome risks for \((L_0,L_1)=(0,0),(0,1),(1,0),(1,1)\) are \(0.10,0.40,0.30,0.70\), respectively.
The formula has one covariate-transition factor, for \(L_1\), and one outcome factor. The four possible \((L_0,L_1)\) paths have the following regime probabilities and contributions to \(P(Y^g=1)\):
| \(L_0,L_1\) | Path probability under \(g\) | Outcome risk | Contribution to \(P(Y^g=1)\) |
|---|---|---|---|
| 0, 0 | \(0.60(1-0.30)=0.42\) | 0.10 | \(0.42(0.10)=0.042\) |
| 0, 1 | \(0.60(0.30)=0.18\) | 0.40 | \(0.18(0.40)=0.072\) |
| 1, 0 | \(0.40(1-0.60)=0.16\) | 0.30 | \(0.16(0.30)=0.048\) |
| 1, 1 | \(0.40(0.60)=0.24\) | 0.70 | \(0.24(0.70)=0.168\) |
Adding the four contributions gives \(P(Y^g=1)=0.042+0.072+0.048+0.168=0.330\). Because \(Y\) is binary, \(P(Y^g=0)=1-0.330=0.670\). These are the regime-specific probabilities, identified from the stated conditional distributions under the assumptions above.
Worked Example: A Dynamic Rule Determines the Later Treatment
Now there are two treatment times, \(A_0\) and \(A_1\), with baseline covariate \(L_0\) and intermediate covariate \(L_1\). Consider the dynamic regime \(A_0=1\) and \(A_1=L_1\): the first treatment is always 1, and the second treatment equals the observed intermediate covariate value. Use hypothetical probabilities \(P(L_0=1)=0.50\), \(P(L_1=1\mid L_0=0,A_0=1)=0.20\), and \(P(L_1=1\mid L_0=1,A_0=1)=0.80\). Suppose the outcome risks at the treatment values prescribed by this rule are 0.05 for \((L_0,L_1,A_1)=(0,0,0)\), 0.30 for \((0,1,1)\), 0.20 for \((1,0,0)\), and 0.60 for \((1,1,1)\).
The formula uses \(p(l_0)\), then \(p(l_1\mid l_0,A_0=1)\), then the outcome probability at \(A_0=1\) and \(A_1=l_1\). The path probabilities are \(0.50(0.80)=0.40\), \(0.50(0.20)=0.10\), \(0.50(0.20)=0.10\), and \(0.50(0.80)=0.40\), in the order \((L_0,L_1)=(0,0),(0,1),(1,0),(1,1)\). Thus,
For example, the \((L_0,L_1)=(0,1)\) path contributes \(0.10(0.30)=0.030\), and its outcome factor is evaluated at \(A_1=1\), not at both possible values of \(A_1\). The rule fixes \(A_1\) once the covariate path is specified; it does not fix \(L_1\), whose possible values are still represented in the sum.
Worked Example: Three Treatment Times and the Full Covariate Product
Let \(L_0\) be constant, followed by treatments \(A_0,A_1,A_2\), with binary covariates \(L_1,L_2\) measured between treatment times. Consider the static regime \((A_0,A_1,A_2)=(0,1,1)\). Suppose \(P(L_1=1\mid A_0=0)=0.40\). Conditional on \(L_1=0\), let \(P(L_2=1\mid A_0=0,A_1=1)=0.20\); conditional on \(L_1=1\), let this probability be \(0.70\). Suppose the outcome risks under the regime are 0.10, 0.30, 0.40, and 0.80 for \((L_1,L_2)=(0,0),(0,1),(1,0),(1,1)\), respectively.
Because \(L_0\) is constant, its probability factor is 1. The product for each path is \(p(l_1\mid A_0=0)p(l_2\mid l_1,A_0=0,A_1=1)\); the outcome factor is evaluated at all three prescribed treatments. The path weights and outcome contributions are:
- \((0,0)\): \(0.60(0.80)=0.48\), giving \(0.48(0.10)=0.048\).
- \((0,1)\): \(0.60(0.20)=0.12\), giving \(0.12(0.30)=0.036\).
- \((1,0)\): \(0.40(0.30)=0.12\), giving \(0.12(0.40)=0.048\).
- \((1,1)\): \(0.40(0.70)=0.28\), giving \(0.28(0.80)=0.224\).
The weights sum to \(0.48+0.12+0.12+0.28=1.00\), as required for a distribution over covariate paths. The regime-specific event probability is \(P(Y^g=1)=0.048+0.036+0.048+0.224=0.356\), and \(P(Y^g=0)=0.644\). The three assigned treatment values enter the conditional covariate and outcome distributions, but none has an observed-treatment probability factor.
Reading and Checking the Product
A useful way to audit a proposed expression is to check the temporal order of every factor. The distribution of \(L_t\) must condition on treatments only through \(A_{t-1}\), since \(A_t\) has not yet been assigned when \(L_t\) is measured. The outcome distribution can condition on the entire treatment and covariate history. For a dynamic regime, substitute its rule recursively so that the treatment values used in each factor correspond to the same covariate path being summed over.
Write baseline covariates, each treatment, each subsequent covariate, and the outcome in their measured order.
For each possible covariate history, determine the treatment value prescribed at each decision time.
Use the baseline distribution, one conditional covariate distribution per later covariate, and the final conditional outcome distribution.
Include every supported path, and check that the path probabilities sum to one when the outcome factor is omitted.
A common mistake is to multiply by the observed probability of receiving each treatment value, such as \(p(A_t=a_t\mid H_t)\), as though the regime described a naturally occurring treatment sequence. That adds probabilities for treatment assignments that the intervention sets rather than draws. The correction is to include the regime-assigned treatment values inside the covariate and outcome conditional distributions, and to sum over the covariate histories that remain variable.
The product form is useful because it makes the longitudinal structure explicit: each covariate distribution reflects the preceding treatment history, and the outcome distribution reflects the completed history. It also makes clear which conditional distributions must be supported by the data for a regime to be identified.
Check Your Understanding
Use the time ordering and product expression to answer the following questions.
- With \(K=2\), which treatment history belongs in the conditional distribution for \(L_2\)? Explain using the measurement order.
- For a dynamic rule \(A_1=L_1\), why does the formula still sum over both possible values of \(L_1\)?
- In a regime-specific outcome distribution, why is there no factor for the probability of receiving \(A_0\) under the observed treatment process?
- What positivity condition is needed when a dynamic rule prescribes treatment according to the covariate history?
- If the covariate-path weights in a calculation sum to 0.93 rather than 1, name one part of the calculation you would check first.