Learn R Programming

plotROC (version 1.2)

calculate_roc: Calculate the ROC curve

Description

Calculate ROC curve given labels and predictions

Usage

calculate_roc(M, D, ci = FALSE, alpha = 0.05)

Arguments

M
continuous marker values or predictions of class labels
D
class labels
ci
Logical, if true, will calculate exact joint confidence regions for the TPF and FPF
alpha
Confidence level, ignored if CI = FALSE

Value

  • Data frame containing cutoffs, and estimated true and false positive fractions

Details

Confidence intervals for TPF and FPF are calculated using the exact method of Clopper and Pearson (1934) each at the level 1 - sqrt(1 - alpha). Based on result 2.4 from Pepe (2003), the cross-product of these intervals yields a 1 - alpha

Examples

Run this code
D.ex <- rbinom(100, 1, .5)
calculate_roc(rnorm(100, mean = D.ex), D.ex)
calculate_roc(rnorm(100, mean = D.ex), D.ex, ci = TRUE)

Run the code above in your browser using DataLab