Learn R Programming

eventglm: Regression Models for Event History Outcomes

A user friendly, easy to understand way of doing event history regression for marginal estimands of interest, including the cumulative incidence and the restricted mean survival, using the pseudo observation framework for estimation. The interface uses the well known formulation of a generalized linear model and allows for features including plotting of residuals, the use of sampling weights, and corrected variance estimation.

Development status

This package is in stable development. The interface is unlikely to have major changes at this time. New features may be added or changed over time.

Installation

install.packages("eventglm")
## or
remotes::install_github("sachsmc/eventglm")

Usage

The main functions users will use are cumincglm and rmeanglm. These are generalized linear regression models for the cumulative incidence and restricted mean of a censored time to event outcome, with or without competing risks. The models are specified just like glm, but the outcome must be a call to Surv (like in coxph), and you must specify the time argument (the fixed time at which the cumulative incidence or restricted mean is computed).

library(eventglm)

colon.cifit <- cumincglm(Surv(time, status) ~ rx, time = 2500, data = colon)
summary(colon.cifit)
se.ci <- sqrt(diag(vcov(colon.cifit, type = "robust")))
b.ci <- coefficients(colon.cifit)

Check out the vignettes for more examples and details.

References

Sachs MC, Gabriel EE (2022). “Event History Regression with Pseudo-Observations: Computational Approaches and an Implementation in R.” Journal of Statistical Software, 102(9), 1-34. doi: 10.18637/jss.v102.i09 (URL: https://doi.org/10.18637/jss.v102.i09).

Per Kragh Andersen and Maja Pohar Perme. Pseudo-observations in survival analysis. Statistical Methods in Medical Research, 19(1):71–99, February 2010. doi: 10.1177/0962280209105020 (URL: http://journals.sagepub.com/doi/10.1177/0962280209105020)

Copy Link

Version

Install

install.packages('eventglm')

Monthly Downloads

417

Version

1.4.5

License

GPL-3

Maintainer

Michael Sachs

Last Published

March 3rd, 2025

Functions in eventglm (1.4.5)

match_cause

Match cause specification against model response
print.pseudoglm

Print method for pseudoglm
leaveOneOut.competing.risks2

Compute jackknife pseudo-observations of the cause-specific cumulative incidence for competing risks
pseudo_independent

Compute pseudo observations under independent censoring
leaveOneOut.survival2

Compute leave one out jackknife contributions of the survival function
pseudo_aareg

Compute censoring weighted pseudo observations
mgus2

Monoclonal gammopathy data
pseudo_infjack

Compute infinitesimal jackknife pseudo observations
residuals.pseudoglm

Pseudo-observation scaled residuals
rmeanglm

Generalized linear models for the restricted mean survival
pseudo_rmst2

Compute pseudo-observations for the restricted mean survival
vcov.pseudoglm

Compute covariance matrix of regression coefficient estimates
summary.pseudoglm

Summary method
reexports

Objects exported from other packages
pseudo_stratified

Compute pseudo observations using stratified jackknife
cumincglm

Generalized linear models for cumulative incidence
confint.pseudoglm

Confidence Intervals for pseudoglm Model Parameters
calc_ipcw_pos

Compute inverse probability of censoring weights pseudo observations
get_pseudo_rmean

Utility to get jackknife pseudo observations of restricted mean
colon

Chemotherapy for Stage B/C colon cancer
jackknife.competing.risks2

Compute jackknife pseudo-observations of the cause-specific cumulative incidence for competing risks
check_mod_cens

Error check censoring model
get_pseudo_cuminc

Utility to get jackknife pseudo observations of cumulative incidence
eventglm

Regression Models for Event History Outcomes
jackknife.survival2

Compute jackknife pseudo-observations of the survival function
pseudo_coxph

Compute censoring weighted pseudo observations
leaveOneOut.survival

Compute leave one out jackknife contributions of the survival function
leaveOneOut.competing.risks

Compute jackknife pseudo-observations of the cause-specific cumulative incidence for competing risks