Accuracy Measures | R Documentation |

Using the available longitudinal information up to a starting time point, this function computes an estimate of the ROC and the AUC at a horizon time point based on joint models.

tvROC(object, newdata, Tstart, ...) ## S3 method for class 'jm' tvROC(object, newdata, Tstart, Thoriz = NULL, Dt = NULL, ...) tvAUC(object, newdata, Tstart, ...) ## S3 method for class 'jm' tvAUC(object, newdata, Tstart, Thoriz = NULL, Dt = NULL, ...) ## S3 method for class 'tvROC' tvAUC(object, ...) calibration_plot(object, newdata, Tstart, Thoriz = NULL, Dt = NULL, df_ns = 3, plot = TRUE, add_density = TRUE, col = "red", lty = 1, lwd = 1, col_dens = "grey", xlab = "Predicted Probabilities", ylab = "Observed Probabilities", main = "", ...) calibration_metrics(object, newdata, Tstart, Thoriz = NULL, Dt = NULL, df_ns = 3, ...) tvBrier(object, newdata, Tstart, Thoriz = NULL, Dt = NULL, ...)

`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 and the event process model that were supplied as the two first argument of |

`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; |

`Dt` |
numeric scalar denoting the length of the time interval of prediction; either |

`df_ns` |
the degrees of freedom for the natural cubic spline of the cloglog transformation of the predicted probabilities used in the Cox model that assess calibration. |

`plot` |
logical; should a plot be produced. If |

`add_density` |
logical; should the kernal density estimation of the predicted probabilities be superimposed in the calibration plot. |

`col, lwd, lty, col_dens, xlab, ylab, main` |
graphical parameters. |

`...` |
additional arguments passed to |

A list of class `tvAUC`

with components:

`auc` |
a numeric scalar denoting the estimated prediction error. |

`Tstart` |
a copy of the |

`Thoriz` |
a copy of the |

`nr` |
a numeric scalar denoting the number of subjects at risk at time |

`classObject` |
the class of |

`nameObject` |
the name of |

A list of class `tvROC`

with components:

`TP, FP, nTP, nFN, nTN, qSN, qSP, qOverall` |
accuracy indexes. |

`F1score, Youden` |
numeric scalars with the optimal cut-point using the F1 score and the Youden index. |

`thr` |
numeric vector of thresholds. |

`Tstart` |
a copy of the |

`Thoriz` |
a copy of the |

`nr` |
a numeric scalar denoting the number of subjects at risk at time |

`classObject` |
the class of |

`nameObject` |
the name of |

Dimitris Rizopoulos d.rizopoulos@erasmusmc.nl

Antolini, L., Boracchi, P., and Biganzoli, E. (2005). A time-dependent discrimination index
for survival data. *Statistics in Medicine* **24**, 3927–3944.

Harrell, F., Kerry, L. and Mark, D. (1996). Multivariable prognostic models: issues in
developing models, evaluating assumptions and adequacy, and measuring and reducing errors.
*Statistics in Medicine* **15**, 361–387.

Heagerty, P. and Zheng, Y. (2005). Survival model predictive accuracy and ROC curves.
*Biometrics* **61**, 92–105.

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.

Rizopoulos, D., Molenberghs, G. and Lesaffre, E.M.E.H. (2017). Dynamic predictions with time-dependent covariates in survival analysis using joint modeling and landmarking. *Biometrical Journal* **59**, 1261–1276.

`predict`

, `jm`

# We fit a multivariate joint model pbc2.id$status2 <- as.numeric(pbc2.id$status != 'alive') CoxFit <- coxph(Surv(years, status2) ~ sex, data = pbc2.id) fm1 <- lme(log(serBilir) ~ ns(year, 3) * sex, data = pbc2, random = ~ ns(year, 3) | id, control = lmeControl(opt = 'optim')) fm2 <- lme(prothrombin ~ ns(year, 2) * sex, data = pbc2, random = ~ ns(year, 2) | id, control = lmeControl(opt = 'optim')) fm3 <- mixed_model(ascites ~ year * sex, data = pbc2, random = ~ year | id, family = binomial()) jointFit <- jm(CoxFit, list(fm1, fm2, fm3), time_var = "year", n_chains = 1L) roc <- tvROC(jointFit, newdata = pbc2, Tstart = 4, Dt = 3, cores = 1L) roc tvAUC(roc) plot(roc, legend = TRUE, optimal_cutoff = "Youden")

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.