Learn R Programming

fbroc (version 0.3.1)

plot.fbroc.roc: Plots a fbroc.roc object

Description

Plot a fbroc.roc object and shows the ROC curve. The confidence region for the ROC curve and the result for a specified performance metric can also be included in the plot.

Usage

## S3 method for class 'fbroc.roc':
plot(x, col = "blue", fill = "royalblue1",
  print.plot = TRUE, show.conf = TRUE, steps = 250, conf.level = 0.95,
  show.metric = NULL, ...)

Arguments

x
Object of class fbroc.roc.
col
Color used for the curve. Defaults to blue.
fill
Color used for the confidence region. Defaults to royalblue1.
print.plot
Logical specifying whether the plot should be printed.
show.conf
Logical specifying whether the confidence region should be plotted.
steps
Number of discrete steps for the FPR at which the TPR is calculated. TPR confidence intervals are given for all FPRs in seq(0, 1, by = (1 / steps)). Defaults to 250.
conf.level
Confidence level of the confidence region.
show.metric
Character specifying which metric to display. See perf.fbroc.roc for details. Defaults to NULL, which means that no metric is displayed.
...
further arguments passed to perf.fbroc.roc.

Value

  • A ggplot, so that the user can customize the plot further.

See Also

boot.roc, perf.fbroc.roc

Examples

Run this code
y <- rep(c(TRUE, FALSE), each = 500)
x <- rnorm(1000) + y
result.boot <- boot.roc(x, y, n.boot = 100)
plot(result.boot)
plot(result.boot, show.metric = "auc")
plot(result.boot, show.metric = "tpr", fpr = 0.2)

Run the code above in your browser using DataLab