if (FALSE) {
# linear mixed model fit
fitLME <- lme(log(serBilir) ~ drug * year, random = ~ 1 | id, data = pbc2)
# survival regression fit
fitSURV <- survreg(Surv(years, status2) ~ drug, data = pbc2.id, x = TRUE)
# joint model fit, under the (default) Weibull model
fitJOINT <- jointModel(fitLME, fitSURV, timeVar = "year")
plot(fitJOINT, 3, add.KM = TRUE, col = "red", lwd = 2)
par(mfrow = c(2, 2))
plot(fitJOINT)
}
Run the code above in your browser using DataLab