{"id":1029,"date":"2018-07-19T11:13:28","date_gmt":"2018-07-19T15:13:28","guid":{"rendered":"http:\/\/www.kaikaichen.com\/?p=1029"},"modified":"2018-07-23T11:11:51","modified_gmt":"2018-07-23T15:11:51","slug":"stata-command-to-calculate-the-area-under-roc-curve","status":"publish","type":"post","link":"https:\/\/www.kaichen.work\/?p=1029","title":{"rendered":"Stata command to calculate the area under ROC curve"},"content":{"rendered":"<p>If we want to evaluate the predictive ability of a logit or probit model,\u00a0Kim and Skinner (2012, JAE, Measuring securities litigation risk) suggest that<\/p>\n<blockquote><p>A better way of comparing the predictive ability of different models is to use the Receiver Operating Characteristic, or ROC curve (e.g., Hosmer and Lemeshow, 2000, Chapter 5). This curve \u2018\u2018plots the probability of detecting a true signal (sensitivity) and false signal (1\u2014speci\ufb01city) for the entire range of possible cutpoints\u2019\u2019 (p. 160, our emphasis). The area under the ROC curve (denoted AUC) provides a measure of the model\u2019s ability to discriminate. A value of 0.5 indicates no ability to discriminate (might as well toss a coin) while a value of 1 indicates perfect ability to discriminate, so the effective range of AUC is from 0.5 to 1.0.\u00a0Hosmer-Lemeshow (2000, p. 162) indicate that AUC of 0.5 indicates no discrimination, AUC of between 0.7 and 0.8 indicates acceptable discrimination, AUC of between 0.8 and 0.9 indicates excellent discrimination, and AUC greater than 0.9 is considered outstanding discrimination.<\/p><\/blockquote>\n<p>The Stata command to report AUC is as follows:<\/p>\n<p><code>logit y x1 x2<\/code>\u00a0or <code>probit y x1 x2<\/code><\/p>\n<p><code>lroc, nograph<\/code><\/p>\n<p>The most recent edition of the book Kim and Skinner refer to is\u00a0Hosmer, D. W., Jr., S. A. Lemeshow, and R. X. Sturdivant. 2013. Applied Logistic Regression. 3rd ed. Hoboken, NJ: Wiley.<\/p>\n<p>A technical note from Stata: <code>lroc<\/code> requires that the current estimation results be from <code>logistic<\/code>, <code>logit<\/code>, <code>probit<\/code>, or <code>ivprobit<\/code>.<\/p>\n<p>A side question: what&#8217;s the difference between logistic and logit regression? Nick Cox&#8217;s short answer is: &#8220;same thing with different emphases in reporting.&#8221; (something like\u00a0one gives you the odds ratios, the other gives you the log of the odds ratios.)\u2014thanks to a <a href=\"https:\/\/stats.stackexchange.com\/questions\/120329\/what-is-the-difference-between-logistic-and-logit-regression\" target=\"_blank\" rel=\"noopener\">post<\/a> on Stack Overflow.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If we want to evaluate the predictive ability of a logit or probit model,\u00a0Kim and Skinner (2012, JAE, Measuring securities litigation risk) suggest that A better way of comparing the predictive ability of different models is to use the Receiver &hellip; <a href=\"https:\/\/www.kaichen.work\/?p=1029\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"_links":{"self":[{"href":"https:\/\/www.kaichen.work\/index.php?rest_route=\/wp\/v2\/posts\/1029"}],"collection":[{"href":"https:\/\/www.kaichen.work\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kaichen.work\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kaichen.work\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kaichen.work\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1029"}],"version-history":[{"count":11,"href":"https:\/\/www.kaichen.work\/index.php?rest_route=\/wp\/v2\/posts\/1029\/revisions"}],"predecessor-version":[{"id":1079,"href":"https:\/\/www.kaichen.work\/index.php?rest_route=\/wp\/v2\/posts\/1029\/revisions\/1079"}],"wp:attachment":[{"href":"https:\/\/www.kaichen.work\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1029"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kaichen.work\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1029"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kaichen.work\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1029"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}