ROC: Plots A ROC Curve and computes AUC

View source: R/ROC.r

ROCR Documentation

Plots A ROC Curve and computes AUC

Description

Plots A ROC Curve and computes AUC

Usage

ROC(formula, data, plot = TRUE, add = FALSE, ...)

Arguments

formula

an object of class formula.

data

an optional data frame containing the variables in the model.

plot

if TRUE, the function plots the ROC curve

add

if TRUE, the ROC curve is added to an existing plot

...

extra parameters for the plot function

Value

an invisible list with components x (the specificity), y (the sensitivity), and AUC (the AUC).

Examples

ROC(T21 ~ hCG, data = T21)
ROC(T21 ~ I(-AFP), T21, add = TRUE, lty = 2)
ROC(T21 ~ I(hCG/100 - 6.8*AFP + 51*age.gest + 33*age), data = T21, add = TRUE, col = "red")
abline(0,1,lty=3)
legend("bottomright", lty = c(1,2,1),
       col = c("black", "black", "red"), legend = c("hCG", "-AFP", "all vars"))

HervePerdry/M1SP documentation built on Dec. 16, 2024, 8:19 p.m.