data("readmission")
# first joint frailty model
joint1 <- frailtyPenal(Surv(t.start,t.stop,event)~ cluster(id) +
dukes + charlson + sex + chemo + terminal(death),
formula.terminalEvent = ~ dukes + charlson + sex + chemo ,
data = readmission, n.knots = 8, kappa = c(2.11e+08,9.53e+11),
recurrentAG=TRUE)
# second joint frailty model without dukes nor charlson as covariates
joint2 <- frailtyPenal(Surv(t.start,t.stop,event)~ cluster(id) +
sex + chemo + terminal(death),
formula.terminalEvent = ~ sex + chemo ,
data = readmission, n.knots = 8, kappa = c(2.11e+08,9.53e+11),
recurrentAG=TRUE)
temps <- c(200,500,800,1100)
# computation of estimators of EPOCE for the two models
epoce1 <- epoce(joint1,temps)
epoce2 <- epoce(joint2,temps)
# computation of the difference
diff <- Diffepoce(epoce1,epoce2)
print(diff)
plot(diff)
Run the code above in your browser using DataLab