A thin wrapper around survival::concordance which essentially just sets reverse = TRUE.

cindex(risk, truth, ...)

Arguments

risk

(numeric())
Vector of risk predictions from a survivalmodel model (so high risk implies low survival time prediction).

truth

(numeric())
Vector of true survival times, must be same length as risk.

...

(ANY)
Further parameters passed to survival::concordance.

Examples

if (!requireNamespace("survival", quietly = TRUE)) {
  set.seed(10)
  data <- simsurvdata(20)
  fit <- deepsurv(data = data[1:10, ])
  p <- predict(fit, type = "risk", newdata = data[11:20, ])
  concordance(risk = p, truth = data[11:20, "time"])
}