Package: gfoRmula Title: Parametric G-Formula Version: 1.1.2 Authors@R: c(person("Victoria", "Lin", role = c("aut"), email = "vlin@alumni.harvard.edu", comment = "V. Lin and S. McGrath made equal contributions"), person("Sean", "McGrath", role = c("aut", "cre"), email = "sean.mcgrath514@gmail.com", comment = c(ORCID = "0000-0002-7281-3516", "V. Lin and S. McGrath made equal contributions")), person("Zilu", "Zhang", role = c("aut"), email = "zilu_zhang@dfci.harvard.edu"), person("Roger W.", "Logan", role = c("aut"), email = "rwlogan@hsph.harvard.edu"), person("Lucia C.", "Petito", role = c("aut"), email = "petito@hsph.harvard.edu"), person("Jing", "Li", role = c("aut"), email = "jing_li@hsph.harvard.edu"), person("McGee", "Emma", role = c("aut"), email = "emcgee@hsph.harvard.edu", comment = c(ORCID = "0000-0002-7456-6408")), person("Cheng", "Carrie", role = c("aut"), email = "zcheng@hsph.harvard.edu"), person("Jessica G.", "Young", role = c("aut"), email = "jyoung@hsph.harvard.edu", comment = c(ORCID = "0000-0002-2758-6932", "M.A. Hernán and J.G. Young made equal contributions")), person("Miguel A.", "Hernán", role = c("aut"), email = "mhernan@hsph.harvard.edu", comment = "M.A. Hernán and J.G. Young made equal contributions"), person("2019 The President and Fellows of Harvard College", role = c("cph"))) Description: 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. Depends: R (>= 3.5.0) License: GPL-3 Encoding: UTF-8 LazyData: true RoxygenNote: 7.3.2 Imports: data.table, ggplot2, ggpubr, grDevices, nnet, parallel, progress, stats, stringr, survival, truncnorm, truncreg, utils Suggests: Hmisc, knitr, randomForest, rmarkdown, testthat (>= 3.0.0) VignetteBuilder: knitr URL: https://github.com/CausalInference/gfoRmula, https://doi.org/10.1016/j.patter.2020.100008 BugReports: https://github.com/CausalInference/gfoRmula/issues Config/testthat/edition: 3 Config/pak/sysreqs: cmake make libicu-dev Repository: https://causalinference.r-universe.dev Date/Publication: 2025-11-03 16:01:40 UTC RemoteUrl: https://github.com/causalinference/gformula RemoteRef: HEAD RemoteSha: 86653ca1315f24a96a41b0ef590af13228f90ab4 NeedsCompilation: no Packaged: 2026-06-14 07:24:47 UTC; root Author: Victoria Lin [aut] (V. Lin and S. McGrath made equal contributions), Sean McGrath [aut, cre] (ORCID: , 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] (ORCID: ), Cheng Carrie [aut], Jessica G. Young [aut] (ORCID: , 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] Maintainer: Sean McGrath