Skip to contents

The Brier score is the mean squared error of a survival probability prediction at a fixed horizon. Censoring makes the naive average biased, because subjects censored before the horizon have unknown status; Graf et al. reweight the observed subjects by the inverse of the censoring survival at their own event time, which restores unbiasedness. The scaled score, 1 - BS(model)/BS(null) with the Kaplan-Meier marginal as the null, is the index of prediction accuracy.

Usage

Brier(time, event, predicted_survival, eval_time, method = "ipcw")

Arguments

time

Observed event or censoring times.

event

Event indicator, 1 = event, 0 = censored.

predicted_survival

Predicted survival at eval_time: a vector of length n, or an n by k matrix for k evaluation times.

eval_time

Scalar or vector of evaluation times.

method

"ipcw" (default) or "naive".

Value

List with brier_score, scaled_brier, integrated_brier, eval_time.

Details

R arm of the existing Python brier module.

Formula: BS(t) = (1/n) [ sum_i w_i I(T_i <= t, d_i = 1) S(t|x_i)^2 + sum_i I(T_i > t) (1 - S(t|x_i))^2 ] with w_i = 1 / G(T_i), G the Kaplan-Meier estimate of censoring.

References

Graf, E., Schmoor, C., Sauerbrei, W. and Schumacher, M. (1999). Assessment and comparison of prognostic classification schemes for survival data. Statistics in Medicine 18(17-18): 2529-2545. Gerds, T. A. and Schumacher, M. (2006). Biometrical Journal 48(6):1029-1040. doi:10.1002/bimj.200610301

Examples

Brier(c(1, 2, 3, 4), c(1, 1, 0, 1), c(0.9, 0.7, 0.5, 0.3), 2.5)
#> $brier_score
#> [1] 0.51
#> 
#> $scaled_brier
#> [1] -1.04
#> 
#> $integrated_brier
#> [1] 0.51
#> 
#> $eval_time
#> [1] 2.5
#>