data(dataDIVAT2)
dataDIVAT2$train <- 1*rbinom(n=dim(dataDIVAT2)[1], size = 1, prob=1/3)
# The training of the super learner with 2 algorithms
sl<-sl.time(method=c("aft.gamma", "ph.gompertz"), metric="ibs",
data=dataDIVAT2[dataDIVAT2$train==1,], times="times", failures="failures", pro.time = 12,
cov.quanti=c("age"), cov.quali=c("hla", "retransplant", "ecd"), cv=3)
# The prognostic capacities from the validation sample
summary(sl, method="sl", pro.time=12,
newdata=dataDIVAT2[dataDIVAT2$train==0,],
times="times", failures="failures")
Run the code above in your browser using DataLab