WAreg: While-Alive Regression for Composite Endpoints with Cluster-Robust Inference

Provides estimation and inference for while-alive regression models targeting the while-alive loss rate for composite endpoints that include recurrent events and a terminal event. The implementation supports flexible time-varying covariate effects through user-selected time bases, including B-splines, natural splines, M-splines, step functions, truncated linear bases, interval-local bases, and piecewise polynomials. Inference can be performed using cluster-robust variance estimators for cluster-randomized trials, with subject-level (IID) variance as a special case. The package includes prediction and plotting utilities and K-fold cross-validation for selecting basis and tuning parameters. Methodology is based on Fang et al. (2025) <doi:10.1093/biostatistics/kxaf047>.

Getting started

Package details

AuthorXi Fang [aut, cre], Hajime Uno [aut], Fan Li [aut]
MaintainerXi Fang <x.fang@yale.edu>
LicenseGPL-3
Version0.1.0
URL https://github.com/fancy575/WAreg
Package repositoryView on CRAN
Installation Install the latest version of this package by entering the following in R:
install.packages("WAreg")

Try the WAreg package in your browser

Any scripts or data that you put into this service are public.

WAreg documentation built on March 6, 2026, 5:07 p.m.