powered by
Calculate C-index for survival data. It's a wrapper function for Hmisc::rcorr.cens().
Hmisc::rcorr.cens()
calc_cindex(data, time_var, event_var, marker_var)
The C-index value.
A data frame containing the survival time, event indicator, and marker variable.
A string specifying the name of the survival time variable in the data frame.
A string specifying the name of the event indicator variable in the data frame.
A string specifying the name of the marker variable in the data frame.
# Calculate C-index using lung dataset from survival package data(cancer, package = "survival") # Use age as the marker variable calc_cindex(lung, "time", "status", "age")
Run the code above in your browser using DataLab