# prederrJM: Prediction Errors for Joint Models In JMbayes: Joint Modeling of Longitudinal and Time-to-Event Data under a Bayesian Approach

## 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

  1 2 3 4 5 6 7 8 9 10 11 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 JMbayes or mvJMbayes. 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 lme()) and the survival model (using coxph()) that were supplied as the two first argument of jointModelBayes. In addition, this data frame should contain a variable that identifies the different subjects (see also argument idVar). 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; Thoriz mast be later than Tstart. lossFun either the options "absolute" or "square" (default), or a user-specified loss function. As the names suggest, when lossFun = "absolute" the loss function is L(x) = |x|, whereas when lossFun = "square" the loss function is L(x) = x^2. If a user-specified function is supplied, this should have a single argument and be vectorized. interval logical; if TRUE the weighted prediction error in the interval [Tstart, Thoriz] is calculated, while if FALSE the prediction error at time Thoriz is calculated using the longitudinal information up to time Tstart. idVar the name of the variable in newdata that identifies the different subjects. simulate logical; if TRUE, a Monte Carlo approach is used to estimate survival probabilities. If FALSE, a first order estimator is used instead. See survfitJM for mote details. M a numeric scalar denoting the number of Monte Carlo samples; see survfitJM for mote details. ... 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} ∑_{i: T_i ≥q s} I(T_i ≥q u) L\{1 - Pr(T_i > u | T_i > t, \tilde{y}_i(t), x_i)\}

+ δ_i I(T_i < u) L\{0 - Pr(T_i > u | T_i > t, \tilde{y}_i(t), x_i)\}

+ (1 - δ_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 ≤q s ≤q t\} denotes the available longitudinal measurements up to time t, T_i denotes the observed event time for subject i, δ_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) = ∑_{i: t ≤q T_i ≤q u} w_i(T_i) PE(T_i | t),

where

w_i(T_i) = \frac{δ_i G(T_i) / G(t)}{∑_{i: t ≤q T_i ≤q u} δ_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. Tstart a copy of the Tstart argument. Thoriz a copy of the Thoriz argument. interval a copy of the interval argument. classObject the class of object. nameObject the name of object. lossFun a copy of the lossFun argument.

## 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.

survfitJM, aucJM, dynCJM, jointModelBayes

## Examples

  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 ## 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) 

JMbayes documentation built on Jan. 9, 2020, 9:07 a.m.