prederrJM {JMbayes} | R Documentation |
Prediction Errors for Joint Models
Description
Using the available longitudinal information up to a starting time point, this function computes an estimate of the prediction error of survival at a horizon time point based on joint models.
Usage
prederrJM(object, newdata, Tstart, Thoriz, ...)
## S3 method for class 'JMbayes'
prederrJM(object, newdata, Tstart, Thoriz,
lossFun = c("square", "absolute"), interval = FALSE, idVar = "id",
simulate = FALSE, M = 100, ...)
## S3 method for class 'mvJMbayes'
prederrJM(object, newdata, Tstart, Thoriz,
lossFun = c("square", "absolute"), interval = FALSE, idVar = "id",
M = 100, ...)
Arguments
object |
an object inheriting from class |
newdata |
a data frame that contains the longitudinal and covariate information for the subjects for which prediction
of survival probabilities is required. The names of the variables in this data frame must be the same as in the data frames that
were used to fit the linear mixed effects model (using |
Tstart |
numeric scalar denoting the time point up to which longitudinal information is to be used to derive predictions. |
Thoriz |
numeric scalar denoting the time point for which a prediction of the survival status is of interest; |
lossFun |
either the options |
interval |
logical; if |
idVar |
the name of the variable in |
simulate |
logical; if |
M |
a numeric scalar denoting the number of Monte Carlo samples; see |
... |
additional arguments; currently none is used. |
Details
Based on a fitted joint model (represented by object
) and using the data supplied in argument newdata
, this function
computes the following estimate of the prediction:
PE(u | t) = \{R(t)\}^{-1} \sum_{i: T_i \geq s} I(T_i \geq u)
L\{1 - Pr(T_i > u | T_i > t, \tilde{y}_i(t), x_i)\}
+ \delta_i I(T_i < u) L\{0 - Pr(T_i > u | T_i > t, \tilde{y}_i(t), x_i)\}
+ (1 - \delta_i) I(T_i < u) [S_i(u \mid T_i, \tilde{y}_i(t)) L\{1 - Pr(T_i > u | T_i > t, \tilde{y}_i(t), x_i)\}
+ \{1 - S_i(u \mid T_i, \tilde{y}_i(t))\} L\{0 - Pr(T_i > u | T_i > t, \tilde{y}_i(t), x_i)\}],
where R(t)
denotes the number of subjects at risk at time t =
Tstart
, \tilde{y}_i(t) = \{y_i(s), 0 \leq s \leq t\}
denotes the available
longitudinal measurements up to time t
, T_i
denotes the observed event time for subject i
, \delta_i
is the event indicator,
s
is the starting time point Tstart
up to which the longitudinal information is used, and u > s
is the horizon time point Thoriz
.
Function L(.)
is the loss function that can be the absolute value (i.e., L(x) = |x|
), the squared value (i.e., L(x) = x^2
),
or a user-specified function. The probabilities Pr(T_i > u | T_i > t, \tilde{y}_i(t), x_i)
are calculated by survfitJM
.
When interval
is set to TRUE
, then function prederrJM
computes the integrated prediction error in the interval
(u,t) =
(Tstart, Thoriz)
defined as
IPE(u | t) = \sum_{i: t \leq T_i \leq u} w_i(T_i) PE(T_i | t),
where
w_i(T_i) = \frac{\delta_i G(T_i) / G(t)}{\sum_{i: t \leq T_i \leq u} \delta_i G(T_i) / G(t)},
with G(.)
denoting
the Kaplan-Meier estimator of the censoring time distribution.
Value
A list of class prederrJM
with components:
prederr |
a numeric scalar denoting the estimated prediction error. |
nr |
a numeric scalar denoting the number of subjects at risk at time |
Tstart |
a copy of the |
Thoriz |
a copy of the |
interval |
a copy of the |
classObject |
the class of |
nameObject |
the name of |
lossFun |
a copy of the |
Author(s)
Dimitris Rizopoulos d.rizopoulos@erasmusmc.nl
References
Henderson, R., Diggle, P. and Dobson, A. (2002). Identification and efficacy of longitudinal markers for survival. Biostatistics 3, 33–50.
Rizopoulos, D. (2016). The R package JMbayes for fitting joint models for longitudinal and time-to-event data using MCMC. Journal of Statistical Software 72(7), 1–45. doi:10.18637/jss.v072.i07.
Rizopoulos, D. (2012) Joint Models for Longitudinal and Time-to-Event Data: with Applications in R. Boca Raton: Chapman and Hall/CRC.
Rizopoulos, D. (2011). Dynamic predictions and prospective accuracy in joint models for longitudinal and time-to-event data. Biometrics 67, 819–829.
See Also
survfitJM
, aucJM
, dynCJM
, jointModelBayes
Examples
## Not run:
# we construct the composite event indicator (transplantation or death)
pbc2$status2 <- as.numeric(pbc2$status != "alive")
pbc2.id$status2 <- as.numeric(pbc2.id$status != "alive")
# we fit the joint model using splines for the subject-specific
# longitudinal trajectories and a spline-approximated baseline
# risk function
lmeFit <- lme(log(serBilir) ~ ns(year, 2), data = pbc2,
random = ~ ns(year, 2) | id)
survFit <- coxph(Surv(years, status2) ~ drug, data = pbc2.id, x = TRUE)
jointFit <- jointModelBayes(lmeFit, survFit, timeVar = "year")
# prediction error at year 10 using longitudinal data up to year 5
prederrJM(jointFit, pbc2, Tstart = 5, Thoriz = 10)
prederrJM(jointFit, pbc2, Tstart = 5, Thoriz = 6.5, interval = TRUE)
## End(Not run)