Learn R Programming

pROC (version 1.19.0.1)

geom_polygon_auc: Add an AUC polygon to a ggroc plot

Description

EXPERIMENTAL - Add an AUC polygon to a ggroc plot.

Usage

# S3 method for auc
geom_polygon_auc(data, legacy.axes = FALSE, ...)
# S3 method for roc
geom_polygon_auc(data, ...)
# S3 method for smooth.roc
geom_polygon_auc(data, ...)

Arguments

data

a roc object from the roc function, same as the one used to build the ggroc initially.

legacy.axes

must match the value given to ggroc.

...

additional aesthetics for geom_polygon to set: alpha, colour, linetype and linewidth.

Details

This is highly experimental and may change in the future.

See Also

ggroc

Examples

Run this code

# Create a ROC curve:
data(aSAH)
roc.s100b <- roc(aSAH$outcome, aSAH$s100b)
roc.s100b.percent <- roc(aSAH$outcome, aSAH$s100b, percent = TRUE)

ggroc(roc.s100b) + geom_polygon_auc(roc.s100b$auc)

# legacy.axes must be repeated
ggroc(roc.s100b.percent, legacy.axes=TRUE) + geom_polygon_auc(roc.s100b.percent, legacy.axes=TRUE)

# Partial AUCs
auc.s100b.partial.sp <- auc(roc.s100b, partial.auc = c(0.9, 1))
auc.s100b.partial.se <- auc(roc.s100b, partial.auc = c(0.8, 0.9), partial.auc.focus="se")

ggroc(roc.s100b) + geom_polygon_auc(auc.s100b.partial.sp)
ggroc(roc.s100b) + geom_polygon_auc(auc.s100b.partial.se)

Run the code above in your browser using DataLab