Software
NICE g-formula
The g-formula (Robins, 1986) uses data with time-varying treatments and confounders to estimate the risk or mean of an outcome under hypothetical treatment strategies specified by the user. The software below implements a plug-in estimator of the non-iterative conditional expectation (NICE) representation of the g-formula.
- R – gfoRmula package
- SAS – GFORMULA macro
- SAS – GFORMULA_RCT macro to estimate the per-protocol effect in randomized trials with protocol deviations
- Python – pygformula package
ICE g-formula
This software implements a plug-in estimator of the iterative conditional expectation (ICE) representation of the g-formula, with a choice between both singly robust and multiply-robust estimators.
- R – gfoRmulaICE package
Inverse Probability Weighting of Marginal Structural Cox Models
- SAS – MSM macros to estimate the parameters of a marginal structural Cox model and estimate risk under hypothetical static interventions (requires SAS IML)
- SAS – Sample program to estimate the parameter of a marginal structural Cox model. 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.
G-estimation of Structural Nested Models
- SAS – SNCFTM 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 as described by Picciotto et al. Structural Nested Cumulative Failure Time Models to Estimate the Effect of Hypothetical Interventions. JASA 2013
- SAS –Sample program to simulate data from a Structural Nested Accelerated Failure Time Model as described by Young et al.
- R – SNCTM R function implements g-estimation of the parameters of a Structural Nested Cumulative Failure Time Model using an instrumental variable, and estimation of marginal cumulative risks under a hypothetical static treatment regime as described by Shi et al., BMC Medical Research Methodology 2021.
Partial Identification Using Instrumental Variables
- SAS – IV_BOUNDS macro provides bounds for the average treatment effect of a binary treatment as described by Swannson et al. Partial identification of the average treatment effect using instrumental variables. JASA 2018; 113(522):933-947.