HSPH Program on Causal Inference

Software

Parametric g-formula to estimate failure risk under interventions in SAS

GFORMULA is a SAS macro to estimate cumulative risk of failure under interventions based on the parametric g-formula. To download the macros and documentation (version 12 July 2012) click here

Questions? Contact Jessica Young

Note: This macro is intended as a tool to facilitate the use of the parametric g-formula  to estimate cumulative risk under interventions by other researchers, but in no way constitute comprehensive pieces of software. Please feel free to get in touch with us if you have questions about using the macro in your research.

Marginal structural Cox model in SAS

This sample program shows how to estimate the parameter of a marginal structural Cox model using inverse probability weighting

To download, click here

An earlier version of this program appeared in the appendix of Hernán, Brumback, and Robins (2000)

Structural models for survival analysis in SAS: the MSM macro

MSM is a set of SAS macros to run  a marginal structural Cox model  and estimate cumulative risk of failure under general static interventions on a treatment variable.

To download, click here (SAS Package IML is needed to run this program)

Questions? Contact  Roger Logan

Nested structural AFT models in STATA: the STGEST command

by Jonathan Sterne and Kate Tilling

This command implements g-estimation of the parameter of a structural nested accelerated failure time model.

To download the STATA commands and help files, click here

Lecture Applications of G-estimation using a new Stata command, Harvard School of Public Health, May 21, 2002. Speakers: Jonathan Sterne and Kate Tilling

Questions? Contact Jonathan Sterne

Marginal structural models in STATA

The article below shows how to use STATA to fit a marginal structural Cox model.

Fewell Z, Hernán MA, Wolfe F, Tilling K, Choi H, Sterne JAC.Controlling for time-dependent confounding using marginal structural models. STATA Journal 2004; 4: 402-420.

Simulating data from a Structural Nested Accelerated Failure Time Model (SNAFTM)

Sample SAS code for simulating data from a SNAFTM.

To download, click here

A description of this simulation is provided in Young JG, Hernán MA, Picciotto S, Robins JM. Relation between three classes of structural models for the effect of a time-varying exposure on survival. Lifetime Data Analysis 2009; DOI 10.1007/s10985-009-9135-3

Initiators SAS macro

The INITIATORS macro is designed to analyze observational longitudinal data to estimate the effect of interventions sustained over time. The premise is to emulate the design and analysis of a hypothetical randomized trial so the Macro uses the language of randomized clinical trials applied to an observational setting. The Macro is capable of conducting the observational analogs of the intention-to-treat, per-protocol and as-treated analyses (see documentation). All analyses are conducted using pooled logistic regression to approximate the hazard ratio from a proportional hazard Cox model.

To download, click here

Question? Contact Roger Logan.

SNCFTM SAS Macro

The SNCFTMshell macro implements in SAS the estimation of population risks under a hypothetical static intervention (on a binary exposure variable referred to as “treatment”) using a Structural Nested Cumulative Failure Time Model.

Download file here.

Questions? Sally Picciotto

Reference:

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 2012 (in press).