Parametric g-formula in SAS: the GFORMULA macro

The GFORMULA macro implements the parametric g-formula (Robins, 1986) in SAS to estimate the risk or mean of an outcome under hypothetical treatment strategies sustained over time (i.e. interventions on time-varying treatments) from longitudinal data with time-varying confounders. To download software, documentation and sample code (version June 2015) click here..

To download software and documentation (version 20 Dec 2013) click here. This version of the GFORMULA macro is no longer supported.

Marginal Structural Cox Models

This sample program shows how to use SAS to estimate the parameter of a marginal structural Cox model via inverse probability weighting. An earlier version of this program appeared in the appendix of Hernán, Brumback, and Robins (2000). This article shows how to use STATA to do the same thing.

Structural models for survival analysis in SAS: the MSM macro

MSM is a set of SAS macros to estimate the parameters of a marginal structural Cox model and estimate risk under hypothetical static interventions.The SAS Package IML is needed to run this program.

Questions? Contact Roger Logan

Structural Nested Accelerated Failure Time Models in STATA: the STGEST command

by Jonathan Sterne and Kate Tilling

The STGEST command implements g-estimation of the parameter of a structural nested accelerated failure time model. See also the lecture Applications of G-estimation using a new Stata command, Harvard T.H. Chan School of Public Health, May 21, 2002.

Questions? Contact Jonathan Sterne

Simulating data from a Structural Nested Accelerated Failure Time Model

To download the sample SAS program click here. For a description of the simulation procedure see this paper by Young JG, Hernán MA, Picciotto S, Robins JM.

Initiators SAS macro

The INITIATORS macro is designed to analyze observational longitudinal data to estimate the effect of interventions sustained over time. The macro can conduct the observational analogs of the intention-to-treat and per-protocol analyses (see documentation). All analyses are conducted using pooled logistic regression to approximate the hazard ratio from a proportional hazard Cox model.

Questions? Contact Roger Logan.

Structural Nested Cumulative Failure Time Models in SAS: the SNCFTM Macro

The SNCFTMshell macro implements g-estimation of the parameters of a Structural Nested Cumulative Failure Time Model, and estimation of risk under a hypothetical static intervention on a binary time-varying treatment.

Questions? Contact Sally Picciotto

Picciotto, S., Hernán, M. A., Page, J.H., Young, J.G., Robins, J.M. “Structural Nested Cumulative Failure Time Models to Estimate the Effect of Hypothetical Interventions”, JASA 2013.