residuals: Extract Residuals for Joint Models

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

residuals is a generic function which extracts residuals from objects returned by jmodelTM() or jmodelMult().

Usage

1
2
3
4
5
6
7
8
## S3 method for class 'jmodelTM'
residuals(object, process = c("Longitudinal", "Survival"), 
            type = c("Marginal", "Conditional", "Standardized-Marginal", 
            "Standardized-Conditional"), ...)
## S3 method for class 'jmodelMult'
residuals(object, process = c("Longitudinal", "Survival"), 
            type = c("Marginal", "Conditional", "Standardized-Marginal", 
            "Standardized-Conditional"), ...)

Arguments

object

an object inheriting from class jmodelTM or jmodelMult.

process

for which process the residuals are calculated, i.e. the longitudinal or the survival process.

type

what type of residuals to calculate for each process. See Details.

...

additional arguments required. None is used in this method.

Details

We have implemented the residual calculation for process = "Longitudinal" but not for process = "Survival" yet as they are not well defined under the joint modeling setting. There are four types of residuals depending on whether to compute the values conditional on the random effects and whether to standardize the residuals. Please refer to Nobre and Single (2007) for details.

With type = "Marginal", the residuals are \varepsilon_{ij} = Y_{ij} - \mathbf{X}_{ij}^\top\boldsymbolβ for objects returned by jmodelTM() and \varepsilon_{ij} = Y_{ij} - \mathbf{B}^\top(t_{ij})\boldsymbolγ for objects returned by jmodelMult(). With type = "Conditional", the residuals are \varepsilon_{ij} = Y_{ij} - \mathbf{X}_{ij}^\top\boldsymbolβ - \mathbf{Z}_{ij}^\top\mathbf{b}_i for objects returned by jmodelTM() and \varepsilon_{ij} = Y_{ij} - b_i\times\mathbf{B}^\top(t_{ij})\boldsymbolγ for objects returned by jmodelMult(). If type = "Standardized-Marginal" or type = "Standardized-Conditional", the above defined residuals are divided by the estimated standard deviation of the corresponding error term.

Value

A numerc vector of residual values.

Author(s)

Cong Xu helenxu1112@gmail.com

References

Nobre, J. S. and Singer, J. M. (2007) Residuals analysis for linear mixed models. Biometrical Jounral 49(6), 863–875.

See Also

fitted.jmodelTM, fitted.jmodelMult

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
fitLME <- lme(proth ~ Trt * obstime, random = ~ 1 | ID, data = liver)
fitCOX <- coxph(Surv(start, stop, event) ~ Trt, data = liver, x = TRUE)
fitJT.ph <- jmodelTM(fitLME, fitCOX, liver, timeVarY = 'obstime')

# residuals for the longitudinal process
residuals(fitJT.ph, type = "Standardized-Conditional")

## End(Not run)

hadjipantelis/JSM documentation built on May 22, 2019, 4:40 p.m.