powered by
Plot an ROC curve.
# 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", ... )
plot.roc provides three plots:
plot.roc
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.
object of class roc.
roc
argument for generic plot function, not used here.
plot
which plots to show (see Details).
indicate whether the plots should be arranged horizontally or vertically.
cutoff value(s) to be shown in the first plot.
cutoff value(s) to be shown in the second plot.
cutoff value(s) to be shown in the third plot.
lable for x axis in third plot.
legend labels for third plot.
xlim for third plot.
ylim for third plot.
legend position for second plot.
legend position for third plot.
other arguments for generic plot function, none are used here.
Mathijs Deen
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