roc.demo: Demonstrate ROC curves by interactively building one

roc.demoR Documentation

Demonstrate ROC curves by interactively building one

Description

This demonstration allows you to interactively build a Receiver Operator Curve to better understand what goes into creating them.

Usage

roc.demo(x = rnorm(25, 10, 1), y = rnorm(25, 11, 1.5))

Arguments

x

Data values for group 1 (controls).

y

Data values for group 2 (cases).

Details

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.

Value

No meaninful value is returned, this function is run solely for the side effects.

Author(s)

Greg Snow 538280@gmail.com

See Also

slider, ROC function in package Epi, auROC in package limma, package ROC

Examples


if(interactive()){
roc.demo()
with(CO2,
  roc.demo(uptake[Type=='Mississippi'],
           uptake[Type=='Quebec']       )
)
}

TeachingDemos documentation built on May 29, 2024, 5:59 a.m.