Learn R Programming

FastJM (version 1.4.2)

residuals: Residuals for joint models

Description

Extract residuals for joint models.

Usage

# S3 method for jmcs
residuals(object, type = c("Marginal", "Subject"), ...)

Value

a vector of residuals of the longitudinal sub-model.

Arguments

object

an object inheriting from class jmcs.

type

what type of residuals to calculate.

...

further arguments passed to or from other methods.

Author

Shanpeng Li lishanpeng0913@ucla.edu

See Also

jmcs

Examples

Run this code
# \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