Comparing Two ROC Curves-Independent Groups Design
Comparing Two ROC Curves-Independent Groups Design
com
Chapter 548
548-1
© NCSS, LLC. All Rights Reserved.
NCSS Statistical Software NCSS.com
Comparing Two ROC Curves – Independent Groups Design
ROC Curves
A receiver operating characteristic (ROC) curve plots the true positive rate (sensitivity) against the false positive
rate (1 – specificity) for all possible cutoff values. General discussions of ROC curves can be found in Altman
(1991), Swets (1996), Zhou et al. (2002), and Krzanowski and Hand (2009). Gehlbach (1988) provides an
example of its use.
Two types of ROC curves can be generated in NCSS: the empirical ROC curve and the binormal ROC curve.
548-2
© NCSS, LLC. All Rights Reserved.
NCSS Statistical Software NCSS.com
Comparing Two ROC Curves – Independent Groups Design
That is, each point on the ROC curve represents a different cutoff value. The points are connected to form the
curve. Cutoff values that result in low false-positive rates tend to result low true-positive rates as well. As the
true-positive rate increases, the false positive rate increases. The better the diagnostic test, the more quickly the
true positive rate nears 1 (or 100%). A near-perfect diagnostic test would have an ROC curve that is almost
vertical from (0,0) to (0,1) and then horizontal to (1,1). The diagonal line serves as a reference line since it is the
ROC curve of a diagnostic test that randomly classifies the condition.
It is recommended that researchers identify whether the scores for the positive and negative groups need to be
transformed to more closely follow the Normal distribution before using the Binormal ROC Curve methods.
548-3
© NCSS, LLC. All Rights Reserved.
NCSS Statistical Software NCSS.com
Comparing Two ROC Curves – Independent Groups Design
assumptions that the Binormal method makes. The other method is the Binormal method presented by Metz
(1978) and McClish (1989). This method results in a smooth ROC curve from which the complete (and partial)
AUC may be calculated.
where
Ψ(𝑋𝑋, 𝑌𝑌) = 0 if 𝑌𝑌 > 𝑋𝑋,
Ψ(𝑋𝑋, 𝑌𝑌) = 1/2 if 𝑌𝑌 = 𝑋𝑋,
Ψ(𝑋𝑋, 𝑌𝑌) = 1 if 𝑌𝑌 < 𝑋𝑋
The empirical AUC is estimated as
𝑛𝑛1 𝑛𝑛0
548-4
© NCSS, LLC. All Rights Reserved.
NCSS Statistical Software NCSS.com
Comparing Two ROC Curves – Independent Groups Design
( )
X ~ N µx , σ x2 , Y ~ N µ y , σ y2 ( )
The ROC curve is traced out by the function
µ y − c
{FP(c), TP(c)} = Φ µσ− c , Φ x
, − ∞ < c < ∞
x σ y
1 µy − c µ − c
c1
σ x c∫2 σ y σ x
= Φ φ x dc
The partial area under an ROC curve is usually defined in terms of a range of false-positive rates rather than the
criterion limits c1 and c2 . However, the one-to-one relationship between these two quantities, given by
ci = µx + σ xΦ −1 ( FPi )
allows the criterion limits to be calculated from desired false-positive rates.
The MLE of A is found by substituting the MLE’s of the means and variances into the above expression and using
numerical integration. When the area under the whole curve is desired, these formulas reduce to
a
A = Φ
1 + b
2
548-5
© NCSS, LLC. All Rights Reserved.
NCSS Statistical Software NCSS.com
Comparing Two ROC Curves – Independent Groups Design
Note that for ease of reading we will often omit the use of the hat to indicate an MLE in the following.
∂A
2
=
E
∂σ x 4π (1 + b )σ xσ y
2
e− k − e− k − [ abE0 1
2σ xσ y 2π (1 + b )
]
2 3/ 2
[Φ (c~1 ) − Φ (c~0 )]
a2
E = exp −
2 1 + b2
( )
∂A a ∂A 2 ∂A
=− −b 2
∂σ y
2
2σ y ∂∆ ∂σ x
) ( )
ab
c~i = Φ −1 ( FPi ) + 1 + b2
1 + b2 (
c~i 2
ki =
2
σ σ
()
2 2
V ∆ = x + y
nx n y
2σ x4
( )
V sx2 =
nx − 1
2σ y4
( )
Vs = 2
y
ny − 1
548-6
© NCSS, LLC. All Rights Reserved.
NCSS Statistical Software NCSS.com
Comparing Two ROC Curves – Independent Groups Design
[( ) ]
n
1
∑ V Tkij − Ak , k = 1,2 i = 0,1
ki
STki =
nki − 1 j =1
n
V(Tk1i ) =
1
(
∑ψ Tk1i , Tk 0 j , k = 1,2 )
k0
nk 0 − 1 j = 1
n
( ) 1
(
∑ψ Tk1i , Tk 0 j , k = 1,2 )
k1
V Tk 0 j =
nk 1 − 1 i = 1
nk 0
∑ V(T ) ∑ V(T )
nk1
k 1i k0 j
j =1
Ak = i =1
= , k = 1,2
nk 1 nk 0
0 if Y > X
ψ ( X , Y ) = 12 if Y = X
1 if Y < X
Here 𝑇𝑇𝑘𝑘0𝑗𝑗 represents the observed diagnostic test result for the jth subject in group k without the condition and
𝑇𝑇𝑘𝑘1𝑗𝑗 represents the observed diagnostic test result for the jth subject in group k with the condition.
548-7
© NCSS, LLC. All Rights Reserved.
NCSS Statistical Software NCSS.com
Comparing Two ROC Curves – Independent Groups Design
FP − FP1 + A
θ ( A) = ln 2
FP2 − FP1 − A
which has the inverse version
eθ − 1
A = ( FP2 − FP1 )
eθ + 1
The variance of this quantity is given by
2( FP2 − FP1 )
2
V(θ ) = V( A)
2
( FP2 − FP1 ) − A
2
Data Structure
The data are entered in three columns. One column specifies the true condition of the individual. Another column
contains the criterion values. The third column defines the groups.
548-8
© NCSS, LLC. All Rights Reserved.
NCSS Statistical Software NCSS.com
Comparing Two ROC Curves – Independent Groups Design
548-9
© NCSS, LLC. All Rights Reserved.
NCSS Statistical Software NCSS.com
Comparing Two ROC Curves – Independent Groups Design
Symbols Section
You can modify the attributes of the symbols using the options in this section.
Titles, Legend, Numeric Axis, Group Axis, Grid Lines, and Background
Tabs
Details on setting the options in these tabs are given in the Graphics Components chapter.
548-10
© NCSS, LLC. All Rights Reserved.
NCSS Statistical Software NCSS.com
Comparing Two ROC Curves – Independent Groups Design
Setup
To run this example, complete the following steps:
2 Specify the Comparing Two ROC Curves – Independent Groups Design procedure options
• Find and open the Comparing Two ROC Curves – Independent Groups Design procedure using the
menus or the Procedure Navigator.
• The settings for this example are listed below and are stored in the Example 1 settings template. To load
this template, click Open Example Template in the Help Center or File menu.
Option Value
Variables Tab
Condition Variable .................................. Condition
Positive Condition Value ......................... 1
Criterion Variable .................................... Score
Criterion Direction ................................... Higher values indicate a Positive Condition
Group Variable........................................ Group
Cutoff Reports Tab
Cutoff Value List ..................................... Data
Counts, TPR (Sensitivity), ...................... Checked
TNR (Specificity), PPV, Accuracy,
TPR + TNR, Prevalence
All Other Reports .................................... Unchecked
AUC Reports Tab
Area Under Curve (AUC) Analysis ......... Checked
(Empirical Estimation)
Test Comparing Two AUCs .................... Checked
(Empirical Estimation)
Confidence Intervals for Comparing ....... Checked
Two AUCs (Empirical Estimation)
All Other Reports .................................... Unchecked
548-11
© NCSS, LLC. All Rights Reserved.
NCSS Statistical Software NCSS.com
Comparing Two ROC Curves – Independent Groups Design
Definitions:
Cutoff Value indicates the criterion value range that predicts a positive condition.
A is the number of True Positives.
B is the number of False Positives.
C is the number of False Negatives.
D is the number of True Negatives.
TPR is the True Positive Rate or Sensitivity = A / (A + C).
TNR is the True Negative Rate or Specificity = D / (B + D).
PPV is the Positive Predictive Value or Precision = A / (A + B).
Accuracy is the Proportion Correctly Classified = (A + D) / (A + B + C + D).
TPR + TNR is the Sensitivity + Specificity.
The report displays, for each group, some of the more commonly used rates for each cutoff value.
548-12
© NCSS, LLC. All Rights Reserved.
NCSS Statistical Software NCSS.com
Comparing Two ROC Curves – Independent Groups Design
Z-Value Upper
Standard to Test 1-Sided 95% Confidence Limits
Group Count AUC Error AUC > 0.5 P-Value Lower Upper
1 50 0.7640 0.0710 3.720 0.0001 0.5860 0.8717
2 60 0.9314 0.0304 14.172 0.0000 0.8392 0.9715
Definitions:
Group is the Criterion group label.
Count is the number of the individuals used in the analysis.
AUC is the area under the ROC curve using the empirical (trapezoidal) approach.
Standard Error is the standard error of the AUC estimate.
Z-Value is the Z-score for testing the designated hypothesis test.
P-Value is the probability level associated with the Z-Value.
The Lower and Upper Confidence Limits form the confidence interval for AUC.
This report gives statistical tests comparing the area under the curve to the value 0.5. The small P-values indicate
a significant difference from 0.5 for both groups. The report also gives the 95% confidence interval for each
estimated AUC.
Definitions:
Group 1 is the category of the Group Variable assigned to Group 1.
Group 2 is the category of the Group Variable assigned to Group 2.
AUC1 is the calculated area under the ROC curve for Group 1.
AUC2 is the calculated area under the ROC curve for Group 2.
Difference (AUC1 - AUC2) is the simple difference AUC1 minus AUC2.
Difference Std Error is the standard error of the AUC difference.
Difference Percent is the Difference (AUC1 - AUC2) expressed as a percent difference from AUC1.
Z-Value is the calculated Z-statistic for testing H0: AUC1 = AUC2.
P-Value is the probability that the true AUC1 equals AUC2, given the sample data.
This report gives a two-sided statistical test comparing the area under the curve of Group 1 to the area under the
curve of Group 2. The small P-value indicates a significant difference between the AUCs.
548-13
© NCSS, LLC. All Rights Reserved.
NCSS Statistical Software NCSS.com
Comparing Two ROC Curves – Independent Groups Design
Definitions:
Group 1 is the category of the Group Variable assigned to Group 1.
Group 2 is the category of the Group Variable assigned to Group 2.
AUC1 is the calculated area under the ROC curve for Group 1.
AUC2 is the calculated area under the ROC curve for Group 2.
Difference (AUC1 - AUC2) is the simple difference AUC1 minus AUC2.
Difference Std Error is the standard error of the AUC difference.
The Lower and Upper Confidence Limits form the confidence interval for the difference between the AUCs.
This report provide the confidence interval for the difference of the area under the curve of Group 1 and the area
under the curve of Group 2.
The plot can be made to contain the empirical ROC curve, the Binormal ROC curve, or both, by making the proper
selection after clicking the ROC Plot Format button.
The coordinates of the points of the ROC curves are the TPR and FPR for each of the unique Score values. The
diagonal (45 degree) line is an ROC curve of random classification, and serves as a baseline. Each ROC curve
shows the overall ability of using the score to classify the condition. The Group 2 curve appears to show better
classification ability and the Group 1 curve.
548-14
© NCSS, LLC. All Rights Reserved.
NCSS Statistical Software NCSS.com
Comparing Two ROC Curves – Independent Groups Design
Setup
To run this example, complete the following steps:
2 Specify the Comparing Two ROC Curves – Independent Groups Design procedure options
• Find and open the Comparing Two ROC Curves – Independent Groups Design procedure using the
menus or the Procedure Navigator.
• The settings for this example are listed below and are stored in the Example 2 settings template. To load
this template, click Open Example Template in the Help Center or File menu.
Option Value
Variables Tab
Condition Variable .................................. Condition
Positive Condition Value ......................... 1
Criterion Variable .................................... Score
Criterion Direction ................................... Higher values indicate a Positive Condition
Group Variable........................................ Group
AUC Reports Tab
Area Under Curve (AUC) ........................ Checked
Analysis (Binormal Estimation)
Test Comparing Two AUCs .................... Checked
(Binormal Estimation)
Confidence Intervals for Comparing ....... Checked
Two AUCs (Binormal Estimation)
Plots Tab
ROC Plot ................................................. Checked
ROC Plot Format (Click the Button)
Empirical ROC Line ............................. Checked
Binormal ROC Line ............................. Checked
548-15
© NCSS, LLC. All Rights Reserved.
NCSS Statistical Software NCSS.com
Comparing Two ROC Curves – Independent Groups Design
Z-Value Upper
Standard to Test 1-Sided 95% Confidence Limits
Group Count AUC Error AUC > 0.5 P-Value Lower Upper
1 50 0.7654 0.0686 3.868 0.0001 0.5944 0.8702
2 60 0.9411 0.0274 16.106 0.0000 0.8560 0.9765
Definitions:
Group is the Criterion group label.
Count is the number of the individuals used in the analysis.
AUC is the area under the ROC curve using the Binormal estimation approach.
Standard Error is the standard error of the AUC estimate.
Z-Value is the Z-score for testing the designated hypothesis test.
P-Value is the probability level associated with the Z-Value.
The Lower and Upper Confidence Limits form the confidence interval for AUC.
This report gives a statistical test comparing the area under the curve to the value 0.5 for each group. The small P-
values indicate a significant difference from 0.5 for both groups. The report also gives the 95% confidence
interval for each estimated AUC.
Definitions:
Group 1 is the category of the Group Variable assigned to Group 1.
Group 2 is the category of the Group Variable assigned to Group 2.
AUC1 is the calculated area under the ROC curve for Group 1.
AUC2 is the calculated area under the ROC curve for Group 2.
Difference (AUC1 - AUC2) is the simple difference AUC1 minus AUC2.
Difference Std Error is the standard error of the AUC difference.
Difference Percent is the Difference (AUC1 - AUC2) expressed as a percent difference from AUC1.
Z-Value is the calculated Z-statistic for testing H0: AUC1 = AUC2. A logistic-type transformation is used in the
calculation of the Z-Value (see documentation).
P-Value is the probability that the true AUC1 equals AUC2, given the sample data.
This report gives a two-sided statistical test comparing the area under the curve of Group 1 to the area under the
curve of Group 2. The small P-value indicates a significant difference between the AUCs.
548-16
© NCSS, LLC. All Rights Reserved.
NCSS Statistical Software NCSS.com
Comparing Two ROC Curves – Independent Groups Design
Definitions:
Group 1 is the category of the Group Variable assigned to Group 1.
Group 2 is the category of the Group Variable assigned to Group 2.
AUC1 is the calculated area under the ROC curve for Group 1.
AUC2 is the calculated area under the ROC curve for Group 2.
Difference (AUC1 - AUC2) is the simple difference AUC1 minus AUC2.
Difference Std Error is the standard error of the AUC difference.
The Lower and Upper Confidence Limits form the confidence interval for the difference between the AUCs.
This report provides the confidence interval for the difference of the area under the curve of Group 1 and the area
under the curve of Group 2.
The Binormal estimation ROC plot is a smooth curve estimation of the true ROC curves. The diagonal (45
degree) line is an ROC curve of random classification, and serves as a baseline. The Binormal estimation ROC
plot and the empirical estimation ROC plot can be superimposed in one plot using the plot format button:
548-17
© NCSS, LLC. All Rights Reserved.
NCSS Statistical Software NCSS.com
Comparing Two ROC Curves – Independent Groups Design
548-18
© NCSS, LLC. All Rights Reserved.
NCSS Statistical Software NCSS.com
Comparing Two ROC Curves – Independent Groups Design
Setup
To run this example, complete the following steps:
2 Specify the Comparing Two ROC Curves – Independent Groups Design procedure options
• Find and open the Comparing Two ROC Curves – Independent Groups Design procedure using the
menus or the Procedure Navigator.
• The settings for this example are listed below and are stored in the Example 3 settings template. To load
this template, click Open Example Template in the Help Center or File menu.
Option Value
Variables Tab
Condition Variable .................................. Disease
Positive Condition Value ......................... Yes
Criterion Variable .................................... Score
Criterion Direction ................................... Higher values indicate a Positive Condition
Group Variable........................................ Method
AUC Reports Tab
Area Under Curve (AUC) Analysis ......... Checked
(Empirical Estimation)
Equivalence Test for Two AUCs............. Checked
(Empirical Estimation)
Lower Equivalence Bound ...................... -0.15
Upper Equivalence Bound ...................... 0.15
548-19
© NCSS, LLC. All Rights Reserved.
NCSS Statistical Software NCSS.com
Comparing Two ROC Curves – Independent Groups Design
Z-Value Upper
Standard to Test 1-Sided 95% Confidence Limits
Method Count AUC Error AUC > 0.5 P-Value Lower Upper
Current 40 0.8883 0.0534 7.268 0.0000 0.7246 0.9571
New 40 0.8710 0.0578 6.416 0.0000 0.7002 0.9475
Definitions:
Group is the Criterion group label.
Count is the number of the individuals used in the analysis.
AUC is the area under the ROC curve using the empirical (trapezoidal) approach.
Standard Error is the standard error of the AUC estimate.
Z-Value is the Z-score for testing the designated hypothesis test.
P-Value is the probability level associated with the Z-Value.
The Lower and Upper Confidence Limits form the confidence interval for AUC.
This report gives a statistical test comparing the area under the curve to the value 0.5 for each group. The small P-
values indicate a significant difference from 0.5 for both groups. The report also gives the 95% confidence
interval for each estimated AUC.
Definitions:
Group 1 is the category of the Group Variable assigned to Group 1.
Group 2 is the category of the Group Variable assigned to Group 2.
AUC1 is the calculated area under the ROC curve for Group 1.
AUC2 is the calculated area under the ROC curve for Group 2.
Difference (AUC1 - AUC2) is the simple difference AUC1 minus AUC2.
Lower P-Value is the P-value for testing H0: AUC1 - AUC2 ≤ LEB vs. H1: AUC1 - AUC2 > LEB.
Upper P-Value is the P-value for testing H0: AUC1 - AUC2 ≥ UEB vs. H1: AUC1 - AUC2 < UEB.
Equivalence P-Value is the P-Value for testing overall equivalence. It is the larger of the Lower and Upper
P-Values.
If the Equivalence P-Value is less than α, H0 is rejected and equivalence may be concluded.
The Lower and Upper Confidence Limits form the equivalence confidence interval. The confidence level
(100 * (1 - 2α)) corresponds to a test based on α. If the equivalence confidence interval is inside the equivalence
bounds, H0 is rejected and equivalence may be concluded.
Conclusion is the determination concerning H0, based on the Equivalence P-Value (or the equivalence confidence
interval).
The Equivalence P-value indicates evidence that the two areas under the curve are equal. Also, the 90%
confidence interval is contained by the equivalence bounds.
548-20
© NCSS, LLC. All Rights Reserved.
NCSS Statistical Software NCSS.com
Comparing Two ROC Curves – Independent Groups Design
The ROC plot shows the similarity of the two areas under the ROC curve.
548-21
© NCSS, LLC. All Rights Reserved.