  G-formula is a popular approach for estimating treatment or exposure effects
from longitudinal data that are subject to time-varying confounding. G-formula
estimation is typically performed by Monte-Carlo simulation, with
non-parametric bootstrapping used for inference. We show that G-formula can be
implemented by exploiting existing methods for multiple imputation (MI) for
synthetic data. This involves using an existing modified version of Rubin's
variance estimator. In practice missing data is ubiquitous in longitudinal
datasets. We show that such missing data can be readily accommodated as part of
the MI procedure when using G-formula, and describe how MI software can be used
to implement the approach. We explore its performance using a simulation study
and an application from cystic fibrosis.
