Skip to content

gfoRmula

Parametric G-Formula

v1.1.1 · Mar 24, 2025 · GPL-3

Description

Implements the non-iterative conditional expectation (NICE) algorithm of the g-formula algorithm (Robins (1986) <doi:10.1016/0270-0255(86)90088-6>, 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) <doi:10.1016/j.patter.2020.100008> for a guide on how to use the package.

Downloads

434

Last 30 days

8736th

1.4K

Last 90 days

6.6K

Last year

Trend: -14.9% (30d vs prior 30d)

CRAN Check Status

14 OK
Show all 14 flavors
Flavor Status
r-devel-linux-x86_64-debian-clang OK
r-devel-linux-x86_64-debian-gcc OK
r-devel-linux-x86_64-fedora-clang OK
r-devel-linux-x86_64-fedora-gcc OK
r-devel-macos-arm64 OK
r-devel-windows-x86_64 OK
r-oldrel-macos-arm64 OK
r-oldrel-macos-x86_64 OK
r-oldrel-windows-x86_64 OK
r-patched-linux-x86_64 OK
r-release-linux-x86_64 OK
r-release-macos-arm64 OK
r-release-macos-x86_64 OK
r-release-windows-x86_64 OK

Check History

OK 14 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Mar 10, 2026

Dependency Network

Dependencies Reverse dependencies data.table ggplot2 ggpubr nnet progress stringr survival truncnorm truncreg gfoRmula

Version History

new 1.1.1 Mar 10, 2026
updated 1.1.1 ← 1.1.0 diff Mar 23, 2025
updated 1.1.0 ← 1.0.4 diff Sep 30, 2024
updated 1.0.4 ← 1.0.3 diff Jan 29, 2024
updated 1.0.3 ← 1.0.2 diff May 17, 2023
updated 1.0.2 ← 1.0.1 diff Feb 26, 2023
updated 1.0.1 ← 1.0.0 diff Jan 11, 2023
updated 1.0.0 ← 0.3.2 diff Apr 8, 2022
updated 0.3.2 ← 0.3.1 diff Jul 12, 2021
updated 0.3.1 ← 0.3.0 diff Mar 22, 2020
updated 0.3.0 ← 0.2.1 diff Jan 29, 2020
new 0.2.1 Aug 24, 2019