How Receiver Operating Characteristic Curves Work

​

20
μ
30
FPR
Visually the ROC curve, shown in the top-right corner, is the shaded area under the right curve versus the shaded area under the left curve as the threshold parameter

varies. A more detailed explanation now follows.
Let
X
be a possible medical diagnostic for disease. For example,
X
, could be eye pressure and the disease could be glaucoma. We suppose that the distribution of
X
in healthy people is
N(20,5)
and in the diseased population it is
N(μ,6)
, where
μ>20
. These curves are shown on the left. The receiver operating characteristic (ROC) curve can be used to visualize and quantify how useful
X
is in the detection of this disease. We suppose that people are diagnosed healthy or diseased according as
X<
or
X≥
. In the above diagram, we show the case where
μ=30
and
=20
. The ROC curve plots sensitivity versus specificity, where
sensitivity=Pr{X≥|diseased}=purpleareainplot
,
specificity=Pr{X<|healthy}=blueareainplot
.
Keeping
μ
fixed, as we vary the threshold parameter,

, we trace out the ROC curve, shown in the upper-right corner. For any fixed value of

, the point shown on the ROC curve corresponds to the two shaded areas.
The usefulness of the test depends on
μ
. The larger
μ
is, the larger the difference between the normal and diseased populations and the easier it is to detect disease. So the diagnostic test improves if
μ
increases. The
AUC
or area under the ROC curve quantifies the usefulness of the test,
0<AUC<1
. Increasing
μ
increases the
AUC
. For large enough
μ
,
AUC≐1
. In our Demonstration,
AUC=0.5
when
μ=20
. In this case, the test is useless and is equivalent to simply random guessing. Obviously, when
μ<20
, the test,
X≥
, is worse than useless!
Sometimes the ROC curve is defined as the plot of FPR versus TPR, where FPR, the false positive rate, is defined as
FPR=1-specificity
and TPR is the true positive rate,
TPR=sensitivity
. Click the FPR checkbox to select this type of plot. In this plot,
FPR
is the area to the right of

for the healthy population and is shown as the colored area under the left curve. When this area overlaps with the curve of the diseased population on the right, the blended color is shown. Similarly TPR is the area to the right of

in the diseased population and is shown as the colored area under the right curve; once again the overlapping area is shown as the blended color.

Details

Denote the cumulative distribution functions of
X
in the healthy and diseased populations by
F
h
(x)
and
F
d
(X)
. Then the tail functions are respectively
T
i
(x)=1-
F
i
(x)
,
i=h,d
. It may be shown that
ROC(t)=
T
d

-1
T
h
(t)
,
t∈(0,1)
and
AUC=
1
∫
0
ROC(t)dt
.
An explicit closed-form formula for AUC in the case of binormal populations is given in[1], p. 34.
The AUC can be interpreted as the probability that a randomly chosen member from the diseased population will have a higher
X
than a randomly chosen member from the healthy population.
An interesting example of the use of ROC curves to compare classifiers is given in[2], figure 9.6, p. 316. See also the Demonstration "Uncertainty of Measurement and Diagnostic Accuracy Measures" for an illustration of the use of ROC to compare two diagnostic tests. In practice, ROC curves are often used to compare a number of diagnostic tests or classifiers.
The glaucoma example discussed in this Demonstration is presented in[4] and there are many similar examples in the references below. Two in-depth treatments of ROC curves are provided in[1] and[3].
[1] W. J. Krzanowski and D. J. Hand, ROC Curves for Continuous Data, CRC/Chapman & Hall, 2009.
[2] T. Hastie, R. Tibshirani, and J. Friedman, The Elements of Statistical Learning: Data Mining, Inference, and Prediction, 2nd ed., New York: Springer, 2009.
[3] M.S. Pepe, The Statistical Evaluation of Medical Tests for Classification and Prediction, New York: Oxford, 2003.
[4] J. A. Swets, R. M. Dawes, and J. Monahan, "Better Decisions through Science," Scientific American, 283, 2000 pp. 82–87.

External Links

Uncertainty of Measurement and Areas Over and Under the ROC Curves
Receiver Operating Characteristic Curves and Uncertainty of Measurement
Pattern Recognition Primer
Signal Detection Theory
Uncertainty of Measurement and Diagnostic Accuracy Measures

Permanent Citation

Ian McLeod
​
​"How Receiver Operating Characteristic Curves Work"​
​http://demonstrations.wolfram.com/HowReceiverOperatingCharacteristicCurvesWork/​
​Wolfram Demonstrations Project​
​Published: March 7, 2011