Learn R Programming

FastJM (version 1.7.0)

DynPredAcc: Dynamic prediction accuracy metrics for joint models

Description

Dynamic prediction accuracy metrics for fitted joint models

Usage

DynPredAcc(
  seed = 100,
  object,
  landmark.time = NULL,
  horizon.time = NULL,
  obs.time = NULL,
  method = c("Laplace", "GH"),
  quadpoint = NULL,
  maxiter = NULL,
  n.cv = 3,
  quantile.width = 0.25,
  opt = c("nlminb", "optim"),
  LOCF = FALSE,
  LOCFcovariate = NULL,
  clongdata = NULL,
  metrics = c("AUC", "Cindex", "Brier Score", "MAE", "MAEQ"),
  cpu.cores = 1,
  ...
)

Value

An object of class DynPredAcc, returned as a list containing:

jm.class

The class of the fitted joint model.

n.cv

The number of cross-validation folds.

landmark.time

The landmark time used for dynamic prediction.

horizon.time

The vector of horizon times used for evaluation.

method

The dynamic prediction approximation method used, if applicable.

quadpoint

The number of quadrature points used, if applicable.

CompetingRisk

Logical value indicating whether the fitted model accounts for competing risks.

seed

The random seed used for cross-validation.

metrics

The requested evaluation metrics.

quantile.width

The width of quantile groups used for quantile-based calibration summaries.

AUC.cv

A list of fold-specific time-dependent AUC estimates, returned when "AUC" is requested.

Cindex.cv

A list of fold-specific concordance index estimates, returned when "Cindex" is requested.

Brier.cv

A list of fold-specific inverse-probability-of- censoring weighted Brier scores, returned when "Brier Score" is requested.

MAE.cv

A list of fold-specific inverse-probability-of- censoring weighted mean absolute errors, returned when "MAE" is requested.

MAEQ.cv

A list of fold-specific quantile-based calibration summaries, returned when "MAEQ" is requested.

Arguments

seed

A numeric value used to set the random seed for cross-validation. Default is 100.

object

A fitted object of class jmcs, JMMLSM, or mvjmcs.

landmark.time

A numeric value specifying the landmark time at which dynamic prediction begins.

horizon.time

A numeric vector of future times at which predicted probabilities are evaluated.

obs.time

A character string specifying the longitudinal time variable in the longitudinal data.

method

A character string specifying the approximation method used for dynamic prediction. Available options are "Laplace" and "GH". This argument is not used for objects of class mvjmcs.

quadpoint

Number of Gauss--Hermite quadrature points used when method = "GH". If NULL, the value stored in object is used.

maxiter

Maximum number of EM iterations allowed when refitting the model within each cross-validation fold. If NULL, the model-specific default is used.

n.cv

Number of cross-validation folds. Default is 3.

quantile.width

Numeric value specifying the width of the quantile groups used for "MAEQ" summaries. Default is 0.25. The reciprocal of quantile.width must be an integer.

opt

Optimization method used when refitting the model in each fold. Available options are "nlminb" and "optim".

LOCF

Logical value indicating whether the last-observation-carried- forward approach is applied for time-dependent survival covariates during prediction. Default is FALSE.

LOCFcovariate

A character vector specifying the time-dependent survival covariates to be updated by last observation carried forward when LOCF = TRUE. Default is NULL.

clongdata

A long-format data frame containing time-dependent survival covariates used when LOCF = TRUE. Default is NULL.

metrics

A character vector specifying which prediction accuracy metrics to compute. Available options are "AUC", "Cindex", "Brier Score", "MAE", and "MAEQ". Default is c("AUC", "Cindex", "Brier Score", "MAE", "MAEQ").

cpu.cores

a number of cpu cores used for parallel computing.

...

Further arguments passed to model-specific methods.

Details

Computes dynamic prediction accuracy measures for fitted joint models of class jmcs, JMMLSM, or mvjmcs using grouped cross-validation.

At each cross-validation fold, the function refits the joint model on the training set, obtains subject-specific dynamic predictions for validation subjects at the requested horizon times, and evaluates the requested prediction accuracy metrics.

Supported metrics include:

"AUC"

Time-dependent area under the ROC curve.

"Cindex"

Concordance index for dynamic predictions.

"Brier Score"

Inverse-probability-of-censoring weighted Brier score.

"MAE"

Inverse-probability-of-censoring weighted mean absolute error.

"MAEQ"

Quantile-based calibration summaries comparing empirical and predicted cumulative incidence rates or survival probabilities.

For competing-risks models, event-specific cumulative incidence predictions are evaluated. For single-event models, conditional survival probabilities are evaluated.

The function performs grouped cross-validation at the subject level. Within each fold, the model is refit on the training data, and dynamic predictions are computed for validation subjects who remain under observation beyond the landmark time and who have longitudinal observations observed up to that time. For single-event models, prediction accuracy is based on conditional survival probabilities. For competing-risks models, prediction accuracy is based on event-specific cumulative incidence functions.

See Also

jmcs, JMMLSM, mvjmcs, survfitjmcs, survfitJMMLSM, survfitmvjmcs