ibs: The Brier Score and Integrated Brier Score (IBS)

View source: R/ibs.R

ibsR Documentation

The Brier Score and Integrated Brier Score (IBS)

Description

Calculate the Brier score and the integration of the Brier score (IBS) using the Inverse Probability of Censoring Weighting (IPCW) method.

Usage

brierScore(object, St, tau)
## Default S3 method:
ibs(object, ...)
## S3 method for class 'coxph'
ibs(object, newdata = NULL, newy = NULL, ...)
## S3 method for class 'lple'
ibs(object, newdata = NULL, newy = NULL, ...)
## S3 method for class 'Surv'
ibs(object, survProb, ...)

Arguments

object

for ibs.Surv and ibs.default, it is a survival object created by Surv(time, event). For others, it is a model object returned by coxph, lple.

newdata

optional new data at which the IBS is calculated. If absent, IBS is for the dataframe used in the original model fit.

newy

optional new survival object data. Default is NULL.

St

the predicted survival function at time tau to calcuate the Brier score.

survProb

the predicted survival function matrix. Row denotes each subject and column denotes each time points. survProb[i,j] denotes the predicted survival probability of the ith subject at the time t[j].

tau

the time point at which the Brier score is calculated.

...

additional arguments to be passed to the functions such as ibs.coxph, ibs.lple, ibs.Surv etc.

Details

The Brier score is the mean square difference between the true survival status and the predicted survival function. The Brier score is defined as,

bs(tau) = 1/n*I(T_i>tau, delta_i = 1) S(t)^2/G(T_i) + (1-S(tau))^2/G(tau),

where G = IPCW(Surv(time, event)), and IPCW is called to fit a KM model for the censoring time.

The IBS is an integrated Brier Score over time. That is an integrated weighted squared distance between the estimated survival function and the empirical survival function int_0 ^ 2 (I(T > t) - S(t))^2dt. The inverse probability censoring weighting(IPCW) is used to adjust for censoring.

Value

A value of the Brier score or integration of the Brier score is returned.

Author(s)

Bingshu E. Chen

References

1. Brier, G. W. (1950). Verification of forecasts expressed in terms of probability. Monthly Weather Review, 78.

2. Graf, Erika, Schmoor, Claudia, Sauerbrei, & Willi, et al. (1999). Assessment and comparison of prognostic classification schemes for survival data. Statistics in Medicine, 18, 2529-2545.

See Also

The IPCW method is used calculate the Brier score and the integrated Brier score. A Cox proportional hazards (PH) model (coxph) shall be fitted to calculate Brier and IBS for the Cox PH model.

The Brier score for the Cox model can also be calculated by brier.

Examples

  set.seed(29)
  n     = 25
  time  = rexp(n, 1)
  event = rbinom(n, 1, 0.75)

  ### calculate the Brier score at time tau
  tau   = 0.5
  St    = pexp(rep(tau, n), 1, lower.tail = FALSE)
  bs    = brierScore(Surv(time, event), St, tau)

  ### calculate the integrated Brier score
  #fit   = coxph(Surv(time, event)~1)
  #IBS  = ibs(fit)

statapps/lpl documentation built on June 1, 2025, 6:58 p.m.