fitted {JSM} | R Documentation |
Extract Fitted Values for Joint Models
Description
fitted
is a generic function which extracts fitted values from objects returned by jmodelTM()
or jmodelMult()
.
Usage
## S3 method for class 'jmodelTM'
fitted(object, process = c("Longitudinal", "Survival"),
type = c("Marginal", "Conditional"), ...)
## S3 method for class 'jmodelMult'
fitted(object, process = c("Longitudinal", "Survival"),
type = c("Marginal", "Conditional"), ...)
Arguments
object |
an object inheriting from class |
process |
for which process the fitted values are calculated, i.e. the longitudinal or the survival process. |
type |
what type of fitted values to calculate for each process. See Details. |
... |
additional arguments required. None is used in this method. |
Details
We have implemented the fitted value calculation for process = "Longitudinal"
but not for process = "Survival"
yet as they are not well defined under the joint modeling setting. There are two types of fitted values depending on whether to compute the values conditional on the random effects. With type = "Marginal"
, the fitted values are \mathbf{X}_i^\top(t)\boldsymbol\beta
for objects returned by jmodelTM()
and \mathbf{B}^\top(t)\boldsymbol\gamma
for objects returned by jmodelMult()
. With type = "Conditional"
, the fitted values are \mathbf{X}_i^\top(t)\boldsymbol\beta + \mathbf{Z}_i^\top(t)\mathbf{b}_i
for objects returned by jmodelTM()
and b_i\times\mathbf{B}^\top(t)\boldsymbol\gamma
for objects returned by jmodelMult()
.
Value
A numeric vector of fitted values.
Author(s)
Cong Xu helenxu1112@gmail.com
Examples
## 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')
# fitted values for the longitudinal process
fitted(fitJT.ph, type = "Conditional")
## End(Not run)