G-computation Created 2026-09-28 Updated 2026-11-05
G-computation calculates the outcome distribution under a specified intervention from conditional laws identified under a causal model. For a single binary treatment, pretreatment covariates , and outcome , the G-formula is
It follows by averaging over , using conditional exchangeability to replace the conditional potential outcome mean by the mean among recipients of , and using consistency in causal inference to replace by observed . Positivity ensures the required conditional outcome laws are represented in the target strata.[ref]
For an illustrative binary outcome, suppose target weights are and in two baseline strata. Untreated risks give intervention risk . Treated risks give , so the standardized causal risk ratio is and the risk difference is . Both strategies use the same target weights.
With repeated treatments and time-varying covariates, the longitudinal G-formula integrates products of the covariate transition laws while setting each treatment according to the intervention strategy. This requires sequential exchangeability, longitudinal positivity and consistency in causal inference. Simply conditioning on every observed intermediate variable can block part of the intended effect; the sequential intervention calculation specifies which laws are averaged.
Causal identification means that is uniquely determined by the observed joint distribution of under the causal assumptions. Equivalently, it admits an identifying formula containing only observed-data probabilities and conditional expectations.
The G-computation formula for this two-stage treatment is
The first factor is the observed mean outcome after the specified treatment history and intermediate value; the second averages over the intermediate-variable distribution generated after the first treatment.
Sequential exchangeability Created 2026-09-28 Updated 2026-11-05
For treatment history , observed history , and final potential outcome , sequential exchangeability requires
at every treatment time. Together with consistency of potential outcomes and positivity in causal inference, it identifies longitudinal effects by G-computation.