data(readmission)
## Gap-time ##
modJoint_gap<-frailtyPenal(Surv(time,event)~cluster(id)+sex+as.factor(dukes)
+as.factor(charlson)+terminal(death),
formula.terminalEvent=~sex+as.factor(dukes)+as.factor(charlson),
data=readmission,n.knots=14,kappa1=9550000000,
kappa2=1410000000000,Frailty=TRUE,joint=TRUE,recurrentAG=FALSE)
# It takes around 1 minute to converge. #
plot(modJoint_gap,type.plot="haz",event="recurrent",conf.bands=TRUE)
plot(modJoint_gap,type.plot="haz",event="terminal",conf.bands=TRUE)
plot(modJoint_gap,type.plot="haz",event="both",conf.bands=TRUE))
plot(modJoint_gap,type.plot="su",event="recurrent",conf.bands=TRUE))
plot(modJoint_gap,type.plot="su",event="terminal",conf.bands=TRUE))
plot(modJoint_gap, event="terminal",type.plot="su",conf.bands=TRUE))
plot(modJoint_gap,type.plot="su","terminal",conf.bands=TRUE))Run the code above in your browser using DataLab