residuals {FastJM} | R Documentation |
Residuals for joint models
Description
Extract residuals for joint models.
Usage
## S3 method for class 'jmcs'
residuals(object, type = c("Marginal", "Subject"), ...)
Arguments
object |
an object inheriting from class |
type |
what type of residuals to calculate. |
... |
further arguments passed to or from other methods. |
Value
a vector of residuals of the longitudinal sub-model.
Author(s)
Shanpeng Li lishanpeng0913@ucla.edu
See Also
Examples
# 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")
))
[Package FastJM version 1.4.2 Index]