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)
Run the code above in your browser using DataLab