Compute the Concordance index for right-censored data
concordance_survival(data, ...)# S3 method for data.frame
concordance_survival(
data,
truth,
estimate,
na_rm = TRUE,
case_weights = NULL,
...
)
concordance_survival_vec(
truth,
estimate,
na_rm = TRUE,
case_weights = NULL,
...
)
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
).
A data.frame
containing the columns specified by truth
and
...
.
Currently not used.
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, an survival::Surv()
object.
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.
A logical
value indicating whether NA
values should be stripped before the computation proceeds.
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()
, or hardhat::frequency_weights()
.
Emil Hvitfeldt
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.
Harrell, F.E., Califf, R.M., Pryor, D.B., Lee, K.L., Rosati, R.A, “Multivariable prognostic models: issues in developing models, evaluating assumptions and adequacy, and measuring and reducing errors”, Statistics in Medicine, 15(4), 361-87, 1996.
concordance_survival(
data = lung_surv,
truth = surv_obj,
estimate = .pred_time
)
Run the code above in your browser using DataLab