plotROCs: ROC Curves plot

plotROCsR Documentation

ROC Curves plot

Description

From a 'DETs' object, this function plots the ROC curves associated with the DET curves in the object. It includes a confidence band when CIs were computed for the DET curves.

Usage

plotROCs(dets, ...)

Arguments

dets

An object of class "DETs".

...

Further graphical arguments passed to the plot function.

Details

It accepts plot customisation with graphical parameters (see plot, for more details):

- 'xlim': a numeric vector of length 2, giving the x and y coordinate ranges of the plot.

- 'col': a vector of colors, specifying the color for each DET curve.

- 'labels_x': a numeric vector indicating the labels of the x- and y-axes.

- 'xlab': a main label for the x-axis.

- 'ylab': a main label for the y-axis.

- 'panel.first': a background grid is plotted. It can be used for modifying the background style of the plot.

Examples

library(DET)
n = 5000
# Predictors with normal distribution
set.seed(1235)
scoreNegative1 = rnorm(n, mean = 0.25, sd = 0.125)
set.seed(5321)
scoreNegative2 = rnorm(n, mean = 0.25, sd = 0.125)
set.seed(6987)
scoreNegative3 = rnorm(n, mean = 0.25, sd = 0.125)
set.seed(11452)
scorePositive1 = rnorm(n, mean = 0.55, sd = 0.125)
set.seed(54321)
scorePositive2 = rnorm(n, mean = 0.65, sd = 0.125)
set.seed(65987)
scorePositive3 = rnorm(n, mean = 0.75, sd = 0.125)
response = as.factor(c(rep(c("target"), times = n), rep(c("nontarget"), times = n)))
predictor1 = c(scoreNegative1, scorePositive1)
predictor2 = c(scoreNegative2, scorePositive2)
predictor3 = c(scoreNegative3, scorePositive3)
predictors = matrix(c(predictor1, predictor2, predictor3), ncol = 3)
colnames(predictors) = c("DET1", "DET2", "DET3")
detCurves = detc(
  response,
  predictors,
  positive = "target",
  names = colnames(predictors)
)
plotROCs(detCurves,
          main = "Example",
          col = c("black", "blue", "red"))

DET documentation built on June 15, 2026, 9:08 a.m.