set.seed(29)
n = 25
time = rexp(n, 1)
event = rbinom(n, 1, 0.75)
x = rnorm(n)
y = Surv(time, event)
### calculate the restricted mean survival time at tau = 0.5
rms = rmst(y, tau = 0.5)
### calculate the integrated brier score
#fit = coxph(y~x)
#RMST = rmst(fit, tau = 2)
Run the code above in your browser using DataLab