Learn R Programming

MDMA (version 2.0.0)

plot.roc: plot roc curve

Description

Plot an ROC curve.

[Stable]

Usage

# S3 method for roc
plot(
  x,
  y,
  which = 1:3,
  orientation = c("horizontal", "vertical"),
  cutoffs.1 = NULL,
  cutoffs.2 = NULL,
  cutoffs.3 = NULL,
  xlab.3 = NULL,
  labels.3 = NULL,
  xlim.3 = NULL,
  ylim.3 = c(0, 10),
  pos.legend.2 = "right",
  pos.legend.3 = "topright",
  ...
)

Value

plot.roc provides three plots:

  • The first plot contains the ROC curve.

  • The second plot contains curves for the sensitivity and the specificity for all threshold values.

  • The third plot contains density plots for the two classification groups.

Arguments

x

object of class roc.

y

argument for generic plot function, not used here.

which

which plots to show (see Details).

orientation

indicate whether the plots should be arranged horizontally or vertically.

cutoffs.1

cutoff value(s) to be shown in the first plot.

cutoffs.2

cutoff value(s) to be shown in the second plot.

cutoffs.3

cutoff value(s) to be shown in the third plot.

xlab.3

lable for x axis in third plot.

labels.3

legend labels for third plot.

xlim.3

xlim for third plot.

ylim.3

ylim for third plot.

pos.legend.2

legend position for second plot.

pos.legend.3

legend position for third plot.

...

other arguments for generic plot function, none are used here.

Author

Mathijs Deen

Examples

Run this code
a <- roc(QIDS$QIDS, QIDS$depression, c("Yes","No"), "Yes")
plot(a, ylim.3 = c(0,.2), xlab.3= "QIDS value", cutoffs.1 = 14.5,
     cutoffs.2 = 14.5, cutoffs.3 = 14.5)

Run the code above in your browser using DataLab