residuals | R Documentation |
Extract residuals for joint models.
## S3 method for class 'jmcs'
residuals(object, type = c("Marginal", "Subject"), ...)
object |
an object inheriting from class |
type |
what type of residuals to calculate. |
... |
further arguments passed to or from other methods. |
a vector of residuals of the longitudinal sub-model.
Shanpeng Li lishanpeng0913@ucla.edu
jmcs
# 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")
))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.