Skip to content

uno1lab/survRuleEval

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

survRuleEval

Evaluation of Survival Prediction Rules

survRuleEval provides functions for fitting and evaluating t-year survival prediction rules using inverse probability of censoring weighted (IPCW) estimating equations. Both Proportional Hazards (PH) and Proportional Odds (PO) link functions are supported. Prediction accuracy is assessed via overall misclassification rate (OMR), sensitivity, specificity, PPV, NPV, and ROC-AUC. Cross-validation (k-fold and Monte Carlo) and perturbation-based confidence intervals are implemented.

Installation

# install.packages("remotes")
remotes::install_github("uno1lab/survRuleEval")

Quick Start

library(survRuleEval)

data(data500)

# Prediction horizon: 2-year survival
t0 <- 365 * 2

# Covariate matrix
covs <- as.matrix(data500[, c("age", "hxmi", "hxdiab", "sbp", "killipb", "egfr")])

# Define competing models (lambda: 0 = PH, 1 = PO)
models <- list(
  list(covs = as.matrix(data500[, c("age", "hxmi", "hxdiab", "sbp", "killipb")]), lambda = 1),
  list(covs = covs, lambda = 1),
  list(covs = covs, lambda = 0)
)

# Run full evaluation pipeline
set.seed(2026)
res <- tyear_run(
  time      = data500$t2death,
  status    = data500$status,
  models    = models,
  t0        = t0,
  nPTB      = 300,
  CV_method = "kfold",
  vfold     = 3,
  seed      = 2026
)

print(res)

Main Functions

Function Description
tyear_run() Full evaluation pipeline (estimation, CV, CI, comparison)
pest2new() IPCW parameter estimation
app.err() Apparent prediction error (OMR, sensitivity, specificity, ROC-AUC)
different.cv.new() K-fold and Monte Carlo cross-validation
pert.se.new() Perturbation-based standard errors
CI95() / CI95d() 95% confidence intervals
find.easy() Extract performance at a chosen operating point

Citation

If you use this package, please cite:

Uno H, Cai T, Tian L, Wei LJ. Evaluating prediction rules for t-year survivors with censored regression models. J Am Stat Assoc. 2007 June;102(478):527–537. doi:10.1198/016214507000000149

citation("survRuleEval")

License

GPL (>= 3)

About

Evaluating prediction rules for t-year survivors

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages