roc.demo | R Documentation |
This demonstration allows you to interactively build a Receiver Operator Curve to better understand what goes into creating them.
roc.demo(x = rnorm(25, 10, 1), y = rnorm(25, 11, 1.5))
x |
Data values for group 1 (controls). |
y |
Data values for group 2 (cases). |
Density plots for the 2 groups will be created in the lower panel of the plot (colored red (group 1) and blue (group 2)) along with rug plots of the actual datapoints. There is also a green vertical line that represents a decision rule cutoff, any points higher than the cutoff are predicted to be in group 2 and points less than the cuttoff are predicted to be in group 1. The sensitivity and specificity for the current cuttoff value are printed below the plot.
A Tk slider box is also created that allows you to move the cuttoff value and update the plots. As the cutoff value changes, the different combinations of sensitivity and specificity are added to the ROC curve in the top panel (the point corresponding to the current cuttoff value is highlighted in red). A line is also drawn from the point representing sensitivity and specificity both equal to 1 to the point closest to it.
No meaninful value is returned, this function is run solely for the side effects.
Greg Snow 538280@gmail.com
slider
, ROC
function in package
Epi, auROC
in package limma, package ROC
if(interactive()){
roc.demo()
with(CO2,
roc.demo(uptake[Type=='Mississippi'],
uptake[Type=='Quebec'] )
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.