boot.roc {adjROC}R Documentation

boot.roc

Description

computes bootstrap AUC and AUCPR for the ROC curve

Usage

boot.roc(
  score,
  class,
  metric = "AUC",
  n = 100,
  method = "emp",
  event_level = "first"
)

Arguments

score

A numeric array of diagnostic score i.e. the estimated probability of each diagnosis

class

A numeric array of equal length of "score", including the actual class of the observations

metric

character. specify the metric of interest which can be "AUC" (Area Under the Curve, default) or "AUCPR" (Area Under the Precision-Recall Curve).

n

number of bootstrap samples.

method

Specifies the method for estimating the ROC curve. Three methods are supported, which are "empirical", "binormal", and "nonparametric"

event_level

character. only needed for bootstrapping AUCPR. this argument specifies which level of the "class" should be considered the positive event. the values can only be "first" or "second".

Value

list including mean and CI of bootstrap value (sensitivity, specificity, or the crossing point) and the bootstrap data.

Examples

# random classification and probability score
score <- runif(10000, min=0, max=1)
class <- sample(x = c(1,0), 10000, replace=TRUE)

# calculate bootstrap AUC of the ROC curve
boot.roc(score = score, class = class, n = 100, metric = "AUC")

# calculate bootstrap AUCPR of the ROC curve
boot.roc(score = score, class = class, n = 100, metric = "AUCPR")

[Package adjROC version 0.3 Index]