Concordance index for right-censored data
Source:R/surv-concordance_survival.R
concordance_survival.Rd
Compute the Concordance index for right-censored data
Usage
concordance_survival(data, ...)
# S3 method for class 'data.frame'
concordance_survival(
data,
truth,
estimate,
na_rm = TRUE,
case_weights = NULL,
...
)
concordance_survival_vec(
truth,
estimate,
na_rm = TRUE,
case_weights = NULL,
...
)
Arguments
- data
A
data.frame
containing the columns specified bytruth
and...
.- ...
Currently not used.
- truth
The column identifier for the true survival result (that is created using
survival::Surv()
.). This should be an unquoted column name although this argument is passed by expression and supports quasiquotation (you can unquote column names). For_vec()
functions, ansurvival::Surv()
object.- estimate
The column identifier for the predicted time, this should be a numeric variables. This should be an unquoted column name although this argument is passed by expression and supports quasiquotation (you can unquote column names). For
_vec()
functions, a numeric vector.- na_rm
A
logical
value indicating whetherNA
values should be stripped before the computation proceeds.- case_weights
The optional column identifier for case weights. This should be an unquoted column name that evaluates to a numeric column in
data
. For_vec()
functions, a numeric vector,hardhat::importance_weights()
, orhardhat::frequency_weights()
.
Value
A tibble
with columns .metric
, .estimator
,
and .estimate
and 1 row of values.
For grouped data frames, the number of rows returned will be the same as the number of groups.
For concordance_survival_vec()
, a single numeric
value (or NA
).
Details
The concordance index is defined as the proportion of all comparable pairs in which the predictions and outcomes are concordant.
Two observations are comparable if:
both of the observations experienced an event (at different times), or
the observation with the shorter observed survival time experienced an event, in which case the event-free subject “outlived” the other.
A pair is not comparable if they experienced events at the same time.
Concordance intuitively means that two samples were ordered correctly by the model. More specifically, two samples are concordant, if the one with a higher estimated risk score has a shorter actual survival time.
Larger values of the score are associated with better model performance.