Weighted NPMLE for Recurrent Events with a Competing Terminal Event
Overview
Provides regression modeling and prediction for the marginal mean of recurrent events in the presence of a competing terminal event using the weighted nonparametric maximum likelihood estimator (wNPMLE) of Bellach and Kosorok (2026) doi:10.48550/arXiv.2605.25934. Two classes of transformation models are implemented: Box-Cox transformation models and logarithmic transformation models. These extend the proportional means model of Ghosh and Lin (2002) doi:10.17615/pt0g-y207 and the transformation model framework of Zeng and Lin (2006) doi:10.1093/biomet/93.3.627. Parameter estimation is performed using automatic differentiation through the Template Model Builder (TMB) framework. Standard errors are computed using sandwich variance estimators that account for estimation of the inverse-probability censoring weights following Bellach, Kosorok, Rüschendorf and Fine (2019) doi:10.1080/01621459.2017.1401540.
- The censoring-corrected sandwich variance (
se = "sandwich_adj", the default) now follows the formula in Bellach and Kosorok (2026, Appendix B.3) exactly. Two coding issues in the correction term were fixed: the correction is now subtracted from the subject-wise scores (which are on the negative log-likelihood scale), and two internal matrices are now filled in the right order. In the settings checked, the effect on the standard errors was in the fourth decimal place or smaller. - Subject-wise scores and the censoring correction are now computed with TMB (new templates in
inst/tmb/), which makesse = "sandwich"andse = "sandwich_adj"much faster for larger data sets. - Compiled TMB templates are now kept between R sessions (in
tools::R_user_dir("wnpmle", "cache")), so they are compiled only once per installed version instead of once per session. A different folder can be set withoptions(wnpmle.cache_dir = ...)or the environment variableWNPMLE_CACHE_DIR, e.g. to share one compiled copy between cluster jobs.
Show all changes in 0.1.3Hide the rest of the changes in 0.1.3
- The meat of the sandwich is computed with
crossprod(), which uses much less memory. - New example data
readmission_prep(): hospital readmissions of 403 colorectal cancer patients with death as terminal event (Gonzalez et al., 2005; copy of thereadmissiondata from frailtypack). The vignette now uses these data as its main example, including model selection withplot_loglik(). The bladder quick start now compares the Ghosh-Lin fit with the estimates reported by Ghosh and Lin (2002). predict()now handles factor covariates (same coding as in the fit), and uses the correct limitlog(1 + x)for the Box-Cox model atrho = 0.summary()now returns an object that is printed once (before, printing the result ofsummary()showed the coefficients twice).plot_loglik(): wider default PDF (width,heightarguments), titles no longer overlap, and the points rho = 1 and r = 1 are labelled.- Documentation:
"sandwich_adj"is listed as the default forse; references now cite the arXiv preprint of Bellach and Kosorok (2026) with its DOI, and DOIs were added to all references where available.
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-04
- NOTE12 OK, 1 NOTE2026-08-01
- OK7 OK2026-06-19
Documentation
- Help pages
- 15 (1 internal)includes a package overview page
- Examples that run
- 40%2 run in a plain check · 3 only when donttest examples are enabled (R CMD check --as-cran)
- Exported functions with examples
- 100%
- Documented parameters
- 95%
- Return-value docs
- 100%
- Help pages citing references
- 27%
Downloads
Repository
Releases over time
Commits over time
3 development-tooling and community-health practices detected across 2 families in the upstream repository
Checks run against github.com/abellach/wnpmle on 2026-10-21.
The R CMD check workflow runs on Linux
Dependencies
Installing wnpmle adds 3 packages (3 with compiled code, 4.2 MB of source tarballs). Heaviest: Rcpp 1.8 MB, RcppEigen 1.7 MB, TMB 763 KB.
Code & Tests
Datasets
People & History
Pick two releases to compare their code metrics.
- 0.1.3Latest2026-10-08 · current release · diff ↗ ··
added 1 export
readmission_preplisted once in CRAN's queue
Seen in one reading of CRAN's incoming queue, at 2026-10-08 20:25 UTC, so it stayed less than the time between readings. - 0.1.22026-06-18
- RR 4.6.0 released · 2026-04-24
Package metadata
- First published
- 2026-06-18
- Total releases
- 2 / 1 yrs
- License
- GPL (>= 3) OSI
- Minimum R
- ≥ 4.1.0
- Download size
- 138 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("wnpmle")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-25, which the citation names so these numbers can be found later. More on citing and the projects behind them.