View source: R/surv-brier_survival_integrated.R
brier_survival_integrated | R Documentation |
Compute the integrated Brier score for right censored data, which is an
overall calculation of model performance for all values of .eval_time
.
brier_survival_integrated(data, ...)
## S3 method for class 'data.frame'
brier_survival_integrated(data, truth, ..., na_rm = TRUE, case_weights = NULL)
brier_survival_integrated_vec(
truth,
estimate,
na_rm = TRUE,
case_weights = NULL,
...
)
data |
A |
... |
The column identifier for the survival probabilities this
should be a list column of data.frames corresponding to the output given when
predicting with censored model. This
should be an unquoted column name although this argument is passed by
expression and supports quasiquotation (you can
unquote column names). For |
truth |
The column identifier for the true survival result (that
is created using |
na_rm |
A |
case_weights |
The optional column identifier for case weights.
This should be an unquoted column name that evaluates to a numeric column
in |
estimate |
A list column of data.frames corresponding to the output given when predicting with censored model. See the details for more information regarding format. |
The integrated time-dependent brier score is calculated in an "area under the
curve" fashion. The brier score is calculated for each value of .eval_time
.
The area is calculated via the trapezoidal rule. The area is divided by the
largest value of .eval_time
to bring it into the same scale as the
traditional brier score.
Smaller values of the score are associated with better model performance.
This formulation takes survival probability predictions at one or more specific evaluation times and, for each time, computes the Brier score. To account for censoring, inverse probability of censoring weights (IPCW) are used in the calculations.
The column passed to ...
should be a list column with one element per
independent experiential unit (e.g. patient). The list column should contain
data frames with several columns:
.eval_time
: The time that the prediction is made.
.pred_survival
: The predicted probability of survival up to .eval_time
.weight_censored
: The case weight for the inverse probability of censoring.
The last column can be produced using parsnip::.censoring_weights_graf()
.
This corresponds to the weighting scheme of Graf et al (1999). The
internal data set lung_surv
shows an example of the format.
This method automatically groups by the .eval_time
argument.
A tibble
with columns .metric
, .estimator
, and .estimate
.
For an ungrouped data frame, the result has one row of values. For a grouped data frame, the number of rows returned is the same as the number of groups.
For brier_survival_integrated_vec()
, a numeric
vector same length as the input argument
eval_time
. (or NA
).
Emil Hvitfeldt
E. Graf, C. Schmoor, W. Sauerbrei, and M. Schumacher, “Assessment and comparison of prognostic classification schemes for survival data,” Statistics in Medicine, vol. 18, no. 17-18, pp. 2529–2545, 1999.
Other dynamic survival metrics:
brier_survival()
,
roc_auc_survival()
library(dplyr)
lung_surv %>%
brier_survival_integrated(
truth = surv_obj,
.pred
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.