powered by
Calculate Harrell's C-index with 95% CI
cindex_calc(model, newdata = NULL, digits = 3)
numeric vector of C-index (lower, upper)
a 'coxph' object
optional validation dataset
number of decimal places for rounding (default 3).
library(survival) fit <- coxph(Surv(time, status) ~ age + sex, data = lung) cindex_calc(fit)
Run the code above in your browser using DataLab