residuals {JM}R Documentation

Residuals for Joint Models

Description

Calculates residuals for joint models.

Usage

## S3 method for class 'jointModel':
residuals(object, process = c("Longitudinal", "Event"), 
  type = c("Marginal", "Subject", "stand-Marginal", 
    "stand-Subject"), ...)

Arguments

object an object inheriting from class jointModel.
process for which model (i.e., linear mixed model or survival model) to calculate residuals.
type what type of residuals to calculate. See Details.
... additional arguments; currently none is used.

Details

Currently residuals are calculated for the longitudinal outcome. If type = "Marginal" these are e_{ij} = y_{ij} - x_{ij}^T hat{β}, whereas for type = "Subject", e_{ij} = y_{ij} - x_{ij}^T hat{β} - z_{ij}^T b_i, where i denotes the subject and j the measurement, y_{ij} the longitudinal responses, x_{ij}^T and z_{ij}^T the corresponding rows of the fixed and random effects design matrices, respectively, and β and b_i denote the fixed effects and random effects components.

If type = "stand-Marginal" or type = "stand-Subject", the above defined residuals are divided by the estimated standard deviation of the error term.

Value

a numeric vector of residual values.

Note

Residuals are not currently computed for the survival outcome.

Author(s)

Dimitris Rizopoulos dimitris.rizopoulos@med.kuleuven.be

See Also

fitted.jointModel

Examples

# linear mixed model fit
fitLME <- lme(sqrt(CD4) ~ obstime * drug - drug, 
    random = ~ 1 | patient, data = aids)
# cox model fit
fitCOX <- coxph(Surv(Time, death) ~ drug, data = aids.id, x = TRUE)

# joint model fit, under the additive log cumulative hazard model
fitJOINT <- jointModel(fitLME, fitCOX, 
    timeVar = "obstime", method = "ch-GH")

head(cbind(
    "Marginal" = residuals(fitJOINT),
    "std-Marginal" = residuals(fitJOINT, type = "stand-Marginal"),
    "Subject" = residuals(fitJOINT, type = "Subject"),
    "std-Subject" = residuals(fitJOINT, type = "stand-Subject")
))

[Package JM version 0.1-0 Index]