Time-Varying Treatments and G-computation
Summary
Time-varying treatments involve sequential assignment over time points, where intermediate confounders are affected by past treatment. Sequential ignorability extends the ignorability assumption to this setting. The g-formula (Robins 1986) identifies the causal effect of a treatment sequence by iterating outcome regression across time. The Bayesian approach applies g-computation: fit a Bayesian model for each component in the g-formula and combine posterior draws.
Overview
In many real-world scenarios, subjects receive treatments sequentially at multiple time points. The challenge: time-varying confounders are affected by both previous treatments and future treatment assignment and outcomes. These settings are called time-varying, sequential, or longitudinal treatments.
Standard ignorability cannot handle this because conditioning on a time-varying confounder simultaneously:
- Removes confounding for the -th treatment
- Opens a collider bias path for earlier treatments
The solution is sequential ignorability combined with the g-formula.
Setup
Consider time points. For unit (; ):
- — baseline time-invariant covariates
- — binary treatment at time
- — time-varying confounders between and (affected by previous treatments)
- — final outcome at time
Treatment sequence: and .
Causal estimand: the marginal effect comparing two pre-specified treatment sequences :
Sequential Ignorability
Assumption 7.2 — Sequential Ignorability
For all :
for all . That is, given all past treatment and covariate history, the current treatment assignment is independent of future potential outcomes.
Sequential ignorability is the time-varying analogue of the standard ignorability assumption. It requires that at each time point, treatment is as-good-as-random conditional on the entire observed history up to that point.
The G-Formula
Theorem: G-Formula (Robins 1986)
Under sequential ignorability, the marginal mean potential outcome for treatment sequence is identified from observed data as:
The g-formula is an extension of the outcome regression identification formula to sequential treatments. It requires:
- A model for the final outcome
- Models for the time-varying confounders at each time point
Bayesian G-Computation
The Bayesian approach applies g-computation: fit Bayesian models for each component in the g-formula, combine posterior draws.
Algorithm:
- Fit a Bayesian outcome model
- Fit Bayesian confounder models for each
- Draw posterior samples jointly
- Compute the g-formula integral by Monte Carlo: simulate from the confounder models under intervention , plug into the outcome model, average
Example 7.3 — Bayesian G-computation with Two Periods
Setup: time periods. : binary baseline covariate. : binary treatment at . : binary time-varying covariate. : binary treatment at . : binary outcome.
Estimand: for any , via:
Posterior computation (with Beta conjugate priors):
- Sample from (8 Bernoulli cells)
- Sample similarly (4 Bernoulli cells)
- Sample from
Then combine to get posterior of and contrasts.
Challenges and Extensions
Scalability: the g-formula becomes intractable as and the dimension of increase — the sum over all history paths requires exponentially many models.
Marginal Structural Models (MSM): A popular alternative (Robins et al. 2000) that models the marginal potential outcome distribution rather than the full conditional. The Bayesian version (Saarela et al. 2016) uses the Bayesian bootstrap.
Dynamic treatment regimes: A closely related topic — sequences of decision rules that individualize treatment over time based on evolving history. Optimal dynamic treatment regimes require combining causal inference + decision theory + reinforcement learning.
G-null Paradox
Robins & Wasserman (2015) showed that unsaturated MSMs might rule out the null hypothesis of zero causal effect a priori — a phenomenon called the g-null paradox. This is an important limitation of MSMs in practice.
Comparison: Bayesian vs. Frequentist
| Approach | Method | Key advantage | Limitation |
|---|---|---|---|
| Frequentist | IPW-based MSM | Computationally simpler | Extreme weights; g-null paradox |
| Frequentist | G-computation | Direct; flexible | Requires many models |
| Bayesian | G-computation | Uncertainty propagation across time | Computationally demanding |
| Bayesian | Marginal structural model (Bayesian bootstrap) | Avoids specifying all confounder models | Relies on IPW; extreme weight issues remain |
Connections
- General Structure of Bayesian CI — data augmentation and posterior imputation generalized to time-varying settings
- Potential Outcomes Framework — SUTVA and the multiple potential outcomes
- Bayesian Outcome Models — each time-step outcome model in the g-formula
- Instrumental Variables and Principal Stratification — principal stratification applied to censoring/time-varying settings
See Also
- Sensitivity Analysis in Observational Studies — sensitivity to unmeasured confounders in longitudinal settings
- Instrumental Variables and Principal Stratification — principal stratification as an alternative framework for complex treatment assignments
- Estimands in Longitudinal Research — the theoretical estimand that sequential treatments must target
- Cross-Lagged and Dynamic Panel Models — frequentist/structural alternatives for dynamic panel estimation
- Bayesian Propensity Score Weighting — IPW-based marginal structural models use propensity score weighting at each time step