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 isIt 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]
Estimating causal effects from epidemiological data by Miguel A. Hernán and James M. Robins. Standardisation; Bibliographical notes on the g-formula; Appendix A.1
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.
Past exam of the mathematics course of the University of Cambridge 2021 iii Paper 221 1 b Solution 2026-09-28
In the second causal directed acyclic graph, depends on but not on , whereas depends on and the two latent roots are independent. HenceAlthough conditioning on conveys information about , the assignment uses only and fresh randomization, soThese are the two sequential exchangeability conditions. Using them successively, together with consistency of potential outcomes, giveswhich is the formula from part a.
Adding invalidates the argument in general. The latent variable confounds and , so need not equal the distribution of . When directly affects , that discrepancy no longer cancels after summing over . The same observed distribution can then correspond to different intervention means, so the displayed formula need not identify the effect.
Past exam of the mathematics course of the University of Cambridge 2021 iii Paper 221 1 c Solution 2026-09-28
Writefor the observed history just before . A sufficient condition is sequential exchangeabilityfor every treatment regime, together with consistency of potential outcomes and positivity in causal inference. Repeated conditioning then gives the longitudinal G-formulaGraphically, it is enough that each be D-separated from the final counterfactual under the specified regime after conditioning on its observed past. The two independences used in part b are precisely the instance.
Sequential exchangeability Created 2026-09-28 Updated 2026-11-05
For treatment history , observed history , and final potential outcome , sequential exchangeability requiresat every treatment time. Together with consistency of potential outcomes and positivity in causal inference, it identifies longitudinal effects by G-computation.