Learn R Programming

DET (version 3.0.0)

plotROCs: ROC Curves plot

Description

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

Usage

plotROCs(dets, ...)

Arguments

dets

An object of class "DETs".

...

Further graphical arguments passed to the plot function.

Details

It accepts plot personalization 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 graphic.

Examples

Run this code
# NOT RUN {
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"))
# }

Run the code above in your browser using DataLab