Implementation of G-computation on a simulated data set: demonstration of a causal inference technique

Am J Epidemiol. 2011 Apr 1;173(7):731-8. doi: 10.1093/aje/kwq472. Epub 2011 Mar 16.


The growing body of work in the epidemiology literature focused on G-computation includes theoretical explanations of the method but very few simulations or examples of application. The small number of G-computation analyses in the epidemiology literature relative to other causal inference approaches may be partially due to a lack of didactic explanations of the method targeted toward an epidemiology audience. The authors provide a step-by-step demonstration of G-computation that is intended to familiarize the reader with this procedure. The authors simulate a data set and then demonstrate both G-computation and traditional regression to draw connections and illustrate contrasts between their implementation and interpretation relative to the truth of the simulation protocol. A marginal structural model is used for effect estimation in the G-computation example. The authors conclude by answering a series of questions to emphasize the key characteristics of causal inference techniques and the G-computation procedure in particular.

Publication types

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

MeSH terms

  • Causality*
  • Computer Simulation
  • Confounding Factors, Epidemiologic
  • Epidemiologic Research Design*
  • Humans
  • Models, Statistical*
  • Regression Analysis