# \donttest{
# linear mixed model fits
fit_lme1 <- lme(log(serBilir) ~ year:sex + age,
random = ~ year | id, data = pbc2)
fit_lme2 <- lme(prothrombin ~ sex,
random = ~ year | id, data = pbc2)
# cox model fit
fit_cox <- coxph(Surv(years, status2) ~ age, data = pbc2.id)
# joint model fit
fit_jm <- jm(fit_cox, list(fit_lme1, fit_lme2), time_var = "year", n_chains = 1L)
# trace plot for the fixed effects in the linear mixed submodels
traceplot(fit_jm, parm = "betas")
# density plot for the fixed effects in the linear mixed submodels
densplot(fit_jm, parm = "betas")
# cumulative quantile plot for the fixed effects in the linear mixed submodels
cumuplot(fit_jm, parm = "betas")
# trace plot for the fixed effects in the linear mixed submodels
ggtraceplot(fit_jm, parm = "betas")
ggtraceplot(fit_jm, parm = "betas", grid = TRUE)
ggtraceplot(fit_jm, parm = "betas", custom_theme = c('1' = 'black'))
# trace plot for the fixed effects in the linear mixed submodels
ggdensityplot(fit_jm, parm = "betas")
ggdensityplot(fit_jm, parm = "betas", grid = TRUE)
ggdensityplot(fit_jm, parm = "betas", custom_theme = c('1' = 'black'))
# }
Run the code above in your browser using DataLab