Parametric G-Formula

Implements the non-iterative conditional expectation (NICE) algorithm of the g-formula algorithm (Robins (1986) , Hernán and Robins (2024, ISBN:9781420076165)). The g-formula can estimate an outcome's counterfactual mean or risk under hypothetical treatment strategies (interventions) when there is sufficient information on time-varying treatments and confounders. This package can be used for discrete or continuous time-varying treatments and for failure time outcomes or continuous/binary end of follow-up outcomes. The package can handle a random measurement/visit process and a priori knowledge of the data structure, as well as censoring (e.g., by loss to follow-up) and two options for handling competing events for failure time outcomes. Interventions can be flexibly specified, both as interventions on a single treatment or as joint interventions on multiple treatments. See McGrath et al. (2020) for a guide on how to use the package.


gfoRmula: Parametric G-Formula

CRAN_Status_Badge R-CMD-check Codecov testcoverage

Installation

You can install the released version of gfoRmula from CRAN with:

install.packages("gfoRmula")

After installing the devtools package (i.e., calling install.packages(devtools)), the development version of gfoRmula can be installed from GitHub with:

devtools::install_github("CausalInference/gfoRmula")

Usage

Please refer to McGrath et al. (2020) for a detailed guide to the gfoRmula package. Also, see the following vignettes regarding updates since McGrath et al. (2020):

  • “A Simplified Approach for Specifying Interventions in gfoRmula”
  • “Using Custom Outcome Models in gfoRmula”

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("gfoRmula")

1.1.1 by Sean McGrath, 2 years ago


https://github.com/CausalInference/gfoRmula, https://doi.org/10.1016/j.patter.2020.100008


Report a bug at https://github.com/CausalInference/gfoRmula/issues


Browse source code at https://github.com/cran/gfoRmula


Authors: Victoria Lin [aut] (V. Lin and S. McGrath made equal contributions) , Sean McGrath [aut, cre] , V. Lin and S. McGrath made equal contributions) , Zilu Zhang [aut] , Roger W. Logan [aut] , Lucia C. Petito [aut] , Jing Li [aut] , McGee Emma [aut] , Cheng Carrie [aut] , Jessica G. Young [aut] , M.A. Hernán and J.G. Young made equal contributions) , Miguel A. Hernán [aut] (M.A. Hernán and J.G. Young made equal contributions) , 2019 The President and Fellows of Harvard College [cph]


Documentation:   PDF Manual  


GPL-3 license


Imports data.table, ggplot2, ggpubr, grDevices, nnet, parallel, progress, stats, stringr, survival, truncnorm, truncreg, utils

Suggests Hmisc, knitr, randomForest, rmarkdown, testthat


See at CRAN