getCindex {cvwrapr} | R Documentation |
Compute C index for a Cox model
Description
Computes Harrel's C (concordance) index for predictions, taking censoring into account.
Usage
getCindex(pred, y, weights = rep(1, nrow(y)))
Arguments
pred |
A vector of predictions. |
y |
Survival response variable, must be a |
weights |
Observation weights (default is all equal to 1). |
Value
The C index for the predictions (a single numeric value).
Examples
set.seed(1)
pred <- rep(1:2, length.out = 10)
y <- survival::Surv(exp(rnorm(10)), rbinom(10, 1, 0.5))
getCindex(pred, y)
[Package cvwrapr version 1.0 Index]