Extract Residuals for Joint Models
residuals
is a generic function which extracts residuals from objects returned by jmodelTM()
or jmodelMult()
.
## 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"), ...)
object |
an object inheriting from class |
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. |
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.
A numerc vector of residual values.
Cong Xu helenxu1112@gmail.com
Nobre, J. S. and Singer, J. M. (2007) Residuals analysis for linear mixed models. Biometrical Jounral 49(6), 863–875.
## 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)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.