# linear mixed model fit
fitLME <- lme(sqrt(CD4) ~ obstime * drug - drug,
random = ~ 1 | patient, data = aids)
# cox model fit
fitCOX <- coxph(Surv(Time, death) ~ drug, data = aids.id, x = TRUE)
# joint model fit, under the additive log cumulative hazard model
fitJOINT <- jointModel(fitLME, fitCOX,
timeVar = "obstime", method = "ch-GH")
# fixed effects for the longitudinal process
fixef(fitJOINT)
# fixed effects + random effects estimates for the longitudinal
# process
coef(fitJOINT)
# fixed effects for the event process
fixef(fitJOINT, process = "Event")
coef(fitJOINT, process = "Event")
# fixed effects for the event process,
# include spline coefficients
fixef(fitJOINT, process = "Event", include.splineCoefs = TRUE)
Run the code above in your browser using DataLab