powered by
Computes Harrel's C (concordance) index for predictions, taking censoring into account.
getCindex(pred, y, weights = rep(1, nrow(y)))
A vector of predictions.
Survival response variable, must be a Surv or stratifySurv object.
Surv
stratifySurv
Observation weights (default is all equal to 1).
The C index for the predictions (a single numeric value).
# NOT RUN { set.seed(1) pred <- rep(1:2, length.out = 10) y <- survival::Surv(exp(rnorm(10)), rbinom(10, 1, 0.5)) getCindex(pred, y) # }
Run the code above in your browser using DataLab