data(dataDIVAT2)
#The outcome model base on a Super Learner and the first 150 individuals of the data base
sl1<-sl.time( methods=c("aft.gamma", "ph.gompertz"), metric="ibs",
data=dataDIVAT2[1:150,], times="times", failures="failures", group="ecd",
cov.quanti=c("age"), cov.quali=c("hla", "retransplant"), cv=3)
#Marginal effect of the treatment (ATE): use 1000 iterations instead of 2
gc.ate <- gc.sl.time(sl1, max.time=12, effect="ATE", iterations=2,
estim.tune=FALSE, estim.weights=FALSE)
#Plot the survival curves
plot(gc.ate, ylab="Confounder-adjusted survival",
xlab="Time post-transplantation (years)", col=c(1,2))
Run the code above in your browser using DataLab