getCindex.Rd
Computes Harrel's C (concordance) index for predictions, taking censoring into account.
getCindex(pred, y, weights = rep(1, nrow(y)))
pred | A vector of predictions. |
---|---|
y | Survival response variable, must be a |
weights | Observation weights (default is all equal to 1). |
The C index for the predictions (a single numeric value).
set.seed(1) pred <- rep(1:2, length.out = 10) y <- survival::Surv(exp(rnorm(10)), rbinom(10, 1, 0.5)) getCindex(pred, y)#> [1] 0.1944444