Integrated Brier Score
eval_bscore(surv_probs, label = NULL, time = NULL, status = NULL, cens_data = NULL, cens_model = "cox", eval_times = NULL, scale = TRUE)
surv_probs | a matrix of survival probabilities |
---|---|
label | a numeric vector of class |
time | (needed iff |
status | (needed iff |
cens_data | (optional) a |
cens_model | Method for estimating inverse probability of censoring weights:
Note: if |
eval_times | A numeric vector giving times at which to compute Brier scores, which will then be used collectively to compute the integrated Brier score. |
scale | ( |
a numeric value. If scale = TRUE
, return values of
0 indicate a non-informative model and values of 1 indicate
a perfect model. If scale = FALSE
, return values of 0 indicate
a perfect model, and return values greater than 0 are difficult
to interpret.
# prodlim needs to be loaded for pec functions to work. library(prodlim) library(survival) set.seed(329) # predict 1/2 for everyone, all the time surv_probs <- matrix( data = rep(1/2, 1000), nrow = 100, ncol = 10 ) # make random time & status values time = runif(100, min = 1, max = 10) status = c(rep(1, 50), rep(0, 50)) # use all the possible times eval_times = seq(1, 10, length.out = 10) # censor data has one variable that is # related to time values cens_data = data.frame(x1 = time + rnorm(100, sd = 1/2)) # note that the Brier score is 1/4, as expected, when # no adjustment is applied for censoring. eval_bscore( surv_probs = surv_probs, label = sgb_label(time, status), eval_times = eval_times, cens_data = cens_data, cens_model = 'marginal', scale = FALSE )#> [1] 0.25# Now adjust for censoring: eval_bscore( surv_probs = surv_probs, label = sgb_label(time, status), eval_times = eval_times, cens_data = cens_data, cens_model = 'cox', scale = FALSE )#> [1] 0.242347