data(readmission)
#-- Gap-time
modJoint.gap <- frailtyPenal(Surv(time,event)~cluster(id)+sex+dukes+
charlson+terminal(death),formula.terminalEvent=~sex+dukes+charlson,
data=readmission,n.knots=14,kappa=c(100,100))
#-- 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,type.plot="su",event="both",conf.bands=TRUE)
Run the code above in your browser using DataLab