What is G-computation?

G-computation is a causal standardization method that estimates an outcome under each intervention by predicting every target unit's outcome under that intervention and averaging those predictions over the target covariate distribution.

Quick Facts

SpecificationOfficial Specification

How It Works

Standardize both interventions to the same population

For each target unit, keep baseline covariates fixed and generate predictions under every treatment strategy. Averaging each prediction column over identical target weights yields comparable intervention means. Using the treated population for one arm and the untreated population for the other reintroduces composition differences rather than estimating a common-population causal contrast.

Outcome-model error and positivity are distinct risks

Flexible regression can reduce misspecification, but sparse treatment-covariate combinations force extrapolation. Inspect overlap and the range of counterfactual predictions, use interactions or learners appropriate to the outcome, cross-fit when the inference procedure supports it, and compare with weighting or Doubly Robust estimates. Snowden and colleagues provide a practical implementation guide.

The longitudinal G-formula handles evolving histories

With time-varying treatment and confounders affected by prior treatment, ordinary adjustment can block causal pathways or induce bias. The parametric G-formula models the sequential data-generating process and simulates covariate and outcome trajectories under sustained or dynamic strategies. It adds substantial model, censoring, support, and Monte Carlo requirements and should be validated with observed-data checks.

Key Characteristics

  • Estimates intervention-specific outcome means by standardization
  • Uses the same target covariate distribution for every intervention
  • Relies primarily on conditional outcome-model predictions
  • Requires consistency, exchangeability, positivity, and valid measurement
  • Extends to longitudinal strategies through the parametric G-formula
  • Needs overlap, model, calibration, and uncertainty diagnostics

Common Use Cases

  1. Standardizing treatment effects to all eligible users
  2. Estimating adjusted risks from a point-treatment outcome model
  3. Comparing G-computation with weighting and Doubly Robust estimates
  4. Simulating sustained treatment strategies with time-varying confounders
  5. Translating stratum-specific outcomes into a deployment-population effect

Example

loading...
Loading code...

Frequently Asked Questions

How does G-computation estimate a causal effect?

It estimates the conditional outcome given treatment and covariates, predicts each target unit under every intervention, averages each intervention's predictions over the same target population, and contrasts those standardized means. Causal interpretation depends on the identification assumptions.

How is G-computation different from inverse-probability weighting?

G-computation models the outcome and standardizes predictions. Inverse-probability weighting models treatment assignment and reweights observed outcomes. Each is vulnerable to misspecification of its nuisance model; Doubly Robust estimators combine both with additional conditions.

Does machine learning make G-computation unbiased?

No. Flexible learners can reduce outcome-model error but cannot remove unmeasured confounding, treatment ambiguity, measurement error, interference, or positivity violations. Inference may also require sample splitting, appropriate variance estimation, or bootstrap procedures.

What is the parametric G-formula?

It is a longitudinal extension that models and simulates time-varying covariates and outcomes under specified treatment strategies. It is useful when confounders evolve and are affected by prior treatment, but it depends on a sequence of correctly specified models and adequate support.

How should a G-computation analysis be checked?

Inspect covariate and treatment overlap, prediction ranges, observed-versus-predicted outcomes, treatment interactions, target-population weights, bootstrap uncertainty, and sensitivity to model choices. Compare compatible estimators and avoid interpreting unsupported extrapolations as observed evidence.

Related Terms