| gg_brier | R Documentation |
Extract the time-resolved Brier score and continuous ranked probability
score (CRPS) for a survival forest grown with randomForestSRC. The
Brier score is computed at each time on object$time.interest, both
overall and stratified by mortality-risk quartile. CRPS is the running
trapezoidal integral of the Brier score, normalised by elapsed time, and
is computed within each quartile and overall.
gg_brier(object, ...)
object |
A fitted |
... |
Currently unused; accepted for S3 dispatch compatibility. |
Wraps get.brier.survival and
rebuilds the quartile decomposition + running CRPS from the returned
brier.matx and mort components, mirroring the computation
in the internal plot.survival function of randomForestSRC. The Brier score uses
inverse-probability-of-censoring weighting; the censoring distribution
is estimated either by Kaplan-Meier (cens.model = "km", the
default) or by a separate censoring forest (cens.model = "rfsrc").
A gg_brier data.frame with columns
event time grid (object$time.interest).
overall Brier score at each time.
Brier score within each mortality-risk quartile (lowest to highest risk).
15th and 85th percentile of per-subject
Brier contributions at each time. Used by
plot.gg_brier(by_quartile = TRUE) to draw an envelope
around the overall curve.
running CRPS (overall) at each time, normalised by elapsed time.
running CRPS within each mortality-risk quartile.
running CRPS of the 15th / 85th per-subject Brier percentile, normalised by elapsed time.
The integrated CRPS (a single scalar matching
get.brier.survival()$crps) is attached as
attr(., "crps_integrated").
Graf E., Schmoor C., Sauerbrei W., Schumacher M. (1999). Assessment and comparison of prognostic classification schemes for survival data. Statistics in Medicine, 18(17-18):2529-2545.
Gerds T.A., Schumacher M. (2006). Consistent estimation of the expected Brier score in general survival models with right-censored event times. Biometrical Journal, 48(6):1029-1040.
plot.gg_brier,
get.brier.survival,
gg_error
## Not run:
data(pbc, package = "randomForestSRC")
rfsrc_pbc <- randomForestSRC::rfsrc(
Surv(days, status) ~ ., data = pbc, nsplit = 10
)
gg_dta <- gg_brier(rfsrc_pbc)
plot(gg_dta)
plot(gg_dta, type = "crps")
plot(gg_dta, envelope = TRUE) # overall line + 15-85% envelope
# Multi-model comparison: stack gg_brier outputs and plot with ggplot2.
rf2 <- randomForestSRC::rfsrc(
Surv(days, status) ~ ., data = pbc, nsplit = 10, mtry = 4
)
compare_dta <- dplyr::bind_rows(
dplyr::mutate(gg_brier(rfsrc_pbc), model = "default"),
dplyr::mutate(gg_brier(rf2), model = "mtry=4")
)
ggplot2::ggplot(compare_dta,
ggplot2::aes(x = time, y = brier, colour = model)) +
ggplot2::geom_line()
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.