data(readmission)
###--- Shared Frailty model with time-varying effect ---###
sha.time <- frailtyPenal(Surv(time,event)~cluster(id)+dukes+charlson+
timedep(sex)+chemo,Frailty=TRUE,data=readmission,n.knots=8,kappa1=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,
joint=TRUE,Frailty=TRUE,data=readmission,n.knots=8,kappa1=1,kappa2=1,
betaknots=3,betaorder=1)
print(joi.time)Run the code above in your browser using DataLab