data(readmission)
###--- Shared Frailty model with time-varying effect ---###
sha.time <- frailtyPenal(Surv(time,event)~cluster(id)+dukes+charlson+
timedep(sex)+chemo,data=readmission,n.knots=8,kappa=1,
betaknots=3,betaorder=1)
#-- print results of the fit and the associated curves for the
#-- time-dependant effects
print(sha.time)
###--- Joint Frailty model with time-varying effect ---###
joi.time <- frailtyPenal(Surv(time,event)~cluster(id)+timedep(sex)+
chemo+terminal(death),formula.terminalEvent=~timedep(sex)+chemo,
data=readmission,n.knots=8,kappa=c(1,1),betaknots=3,betaorder=1)
print(joi.time)
Run the code above in your browser using DataLab