Interactive Plot

Mouse over to view cutoff labels. Click to view confidence region.
Download

Print Plot

Download

Upload and select data

Files must be comma-delimited, with header containing column names. At least one column must contain the binary (0/1) outcome, and one must contain the continuous marker or predictor.

Specify Variables

Plot options

separate multiple curve labels with commas

Usage

The web app comes pre-loaded with an example dataset. Use this example to familiarize yourself with the functions.

Uploading data

To upload your own data, click on the “upload data” button. Data files must be comma delimited, with the first row containing a header of the column names. This can be done in Excel by saving the file as .csv.

Specify the outcome

The first step is to specify the outcome variable by choosing one from the drop-down list. The outcome variable must be binary, meaning that it can only have 2 levels, typically 0/1.

Specify the marker variable(s)

The next step is to specify the marker variable. This can and should be continuous. To create multiple curves on a single plot, check the check box that is labeled “Check to plot multiple curves”. Then you can select multiple marker variables from the selection box.

Customize

Plot customization options are on the lower right. You can add a title, curve labels, adjust the label positioning, and adjust the cutoff number and font size.

Download

Click the download buttons to save your plots to your computer. Downloading the interactive plot will generate html code that can be opened in a web browser. Open this code in a text editor and you can copy it directly into your own web-page. Downloading the print plot will save a pdf version.

Help and feedback

We welcome you feedback. If you have difficulties, or suggestions for improvements, send me an email at michael.sachs@nih.gov.


What is an ROC curve?

In medicine and other applications, we often use a biomarker or a test to predict an underlying condition, disease state, or future event. For a binary test and a binary disease state, the following table summarizes the possible errors that one can make using the test as a prediction of a disease state measured by some gold standard

Condition
(as determined by “Gold standard”)
Total population Condition positive Condition negative Prevalence =
Σ Condition positive
Σ Total population
Test
outcome
Test
outcome
positive
True positive False positive
Positive predictive value (PPV) =
Σ True positive
Σ Test outcome positive
Test
outcome
negative
False negative
True negative Negative predictive value (NPV) =
Σ True negative
Σ Test outcome negative
True positive fraction (TPF, Sensitivity) =
Σ True positive
Σ Condition positive
False positive fraction (FPF) =
Σ False positive
Σ Condition negative
Accuracy (ACC) =
Σ True positive + Σ True negative
Σ Total population
False negative fraction (FNF) =
Σ False negative
Σ Condition positive
True negative fraction (TNF, Specificity) =
Σ True negative
Σ Condition negative

This table was adapted from the ROC curve Wikipedia page

If the test is continuous, say \(M\), then a test positive is defined as \(M > c\). Now we consider measures of accuracy as functions of \(c\), i.e.

\[ TPF(c) = Pr\{M > c | D = 1\} \] \[ FPF(c) = Pr\{M > c | D = 0\} \]

The ROC curve is a plot of \(FPF(c)\) versus \(TPF(c)\). It’s purpose is to allow the viewer to assess the accuracy of the test \(M\) for any possible value of the cutoff \(c\). This aids in deciding what cutoff to use in practice, comparing different tests for the same thing, and for evaluating the overall accuracy. A key advantage of our approach is that the values of the cutoffs are visible!

About

Most ROC curve plots obscure the cutoff values and inhibit interpretation and comparison of multiple curves. This attempts to address those shortcomings by providing plotting and interactive tools.

This is a web-based implementation of the plotROC package in R. You can learn more about the plotROC package here: plotROC homepage

Acknowledgements

This package would not be possible without the following:

License

The MIT License (MIT)

Copyright (c) 2014 Michael C Sachs

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.