brier | R Documentation |
Computes the Brier score at a fixed time point using inverse probability of censoring weights (IPCW).
brier(object, pre_sp, t_star)
object |
A 'Surv' object with observed time and status. |
pre_sp |
A numeric vector of predicted survival probabilities at 't_star'. |
t_star |
The evaluation time point. |
A single numeric value representing the Brier score.
library(survival)
data(veteran, package = "survival")
mod <- survdnn(Surv(time, status) ~
age + karno + celltype, data = veteran, epochs = 50, verbose = FALSE)
pred <- predict(mod, newdata = veteran, type = "survival", times = c(30, 90, 180))
y <- model.response(model.frame(mod$formula, veteran))
survdnn::brier(y, pre_sp = pred[["t=90"]], t_star = 90)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.