A Bayesian approach to the g-formula

Stat Methods Med Res. 2018 Oct;27(10):3183-3204. doi: 10.1177/0962280217694665. Epub 2017 Mar 2.


Epidemiologists often wish to estimate quantities that are easy to communicate and correspond to the results of realistic public health interventions. Methods from causal inference can answer these questions. We adopt the language of potential outcomes under Rubin's original Bayesian framework and show that the parametric g-formula is easily amenable to a Bayesian approach. We show that the frequentist properties of the Bayesian g-formula suggest it improves the accuracy of estimates of causal effects in small samples or when data are sparse. We demonstrate an approach to estimate the effect of environmental tobacco smoke on body mass index among children aged 4-9 years who were enrolled in a longitudinal birth cohort in New York, USA. We provide an algorithm and supply SAS and Stan code that can be adopted to implement this computational approach more generally.

Keywords: Bayesian; causal inference; g-computation; semiparametric.

Publication types

  • Research Support, N.I.H., Extramural
  • Research Support, Non-U.S. Gov't

MeSH terms

  • Algorithms
  • Bayes Theorem*
  • Body Mass Index
  • Child
  • Child, Preschool
  • Humans
  • Longitudinal Studies
  • Models, Statistical
  • New York
  • Observational Studies as Topic
  • Public Health*
  • Tobacco Smoke Pollution / adverse effects


  • Tobacco Smoke Pollution