Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: weird ROC curve


From   Joseph Coveney <[email protected]>
To   [email protected]
Subject   Re: st: weird ROC curve
Date   Sat, 07 Dec 2002 10:14:53 +0900

Arnold Kester posted, "I just produced the weirdest ROC curve I've ever seen, and I 
suspect there's a bug in roctab. The curve jumps up and down which is by definition not 
possible. For your amusement and curiosity I append the data. I am aware that as a 
diagnostic, x is worthless to predict y."

ROC curves are conventionally defined to lie above the diagonal, i.e., the area under 
the ROC curve is supposed to be greater than 50%.  -roctab- indicates that the area 
under the ROC curve is less than 50% for Arnold's data, meaning that the diagnostic 
test (slightly) predicts the diametric opposite of the truth.  (This is due to chance, since 
as Arnold notes the diagnostic test is entirely worthless.)  By replacing y with its obverse 
in order to comply with convention, the ROC graph will appear normal.

Joseph Coveney

=========== begin roc_data.do

insheet using roc_data.out, names clear
logit y x
* the slope coefficient is _negative_
replace y=y==0
roctab y x, graph
exit

========== end roc_data.do

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index