Learn R Programming

survivalmodels (version 0.1.9)

cindex: Compute Concordance of survivalmodel Risk

Description

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

Usage

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

Run this code
# NOT RUN {
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"])
}
# }

Run the code above in your browser using DataLab