# \donttest{
# a joint model fit
fit <- jmcs(ydata = ydata, cdata = cdata,
long.formula = response ~ time + gender + x1 + race,
surv.formula = Surv(surv, failure_type) ~ x1 + gender + x2 + race,
random = ~ time| ID)
# residuals of the longitudinal sub-model
head(cbind(
"Marg" = residuals(fit, type = "Marginal"),
"Subj" = residuals(fit, type = "Subject")
))
# }
Run the code above in your browser using DataLab