get_auc: Calculate the Area under the Receiver Operating...

get_aucR Documentation

Calculate the Area under the Receiver Operating Characteristics Curve

Description

Use the timeROC package to calculate the ROC-AUC based on predictions from the mmm_predictions function.

Usage

get_auc(
  predictions,
  prediction_landmark,
  prediction_horizon,
  id,
  failure_time,
  failure
)

Arguments

predictions

predictions data from the mmm_predictions function.

prediction_landmark

a numeric vector with the landmark times to select predictions.

prediction_horizon

the prediction horizon at which to calculate the ROC-AUC.

id

a character value for the name of the vector of subject identifiers in the predictions data.

failure_time

a character value for the name of the vector with failure times in the predictions data.

failure

a character value for th name of the vector with failure status.

Details

Uses the timeROC package to determine the area under the receiver operating characteristics curve.

Examples

# Get the ROC-AUC for a single landmark
## Not run: 
get_auc(
  predictions=predictions,
  prediction_landmark=1,
  prediction_horizon=5,
  id="id",
  failure_time="ftime",
  failure="failure")

# Get the ROC-AUC for a series of landmarks from a list of predictions
lm <- 1:5
lapply(seq_along(lm), function(l) {
  get_auc(
    predictions=predictions_test[[l]],
    prediction_landmark=lm[l],
    prediction_horizon=horizon,
    id="transnr",
    failure_time="stime",
    failure="failure"
  )
})

## End(Not run)

JanvandenBrand/jmmm documentation built on May 30, 2022, 9:37 a.m.