Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Not sure what's going on with AUC calculations?

    Hello!

    I am using Stata 12 and have a question about ROC curves and AUC calculations. This is pretty simple in Stata but for some reason I have been getting strange numbers that I did not think was possible. Perhaps it is my low statistical understanding or some misuse of Stata. I'm unsure.
    I am calculating an AUC for each of my variables with my outcome in my univariate model. I want to show how much of the outcome each variables can predict. Eventually I will make a risk score and also plot an AUC but I am not there yet.
    My problem is that my AUC is <0.50 for the majority of my variables. From my understanding the AUC has to be >0.5.

    I will give an example of one variable. The outcome variable is prevdis (0 is no, 1 is yes) and the predictor variable is nutritionstat which is has 0,1,2 options

    Here is my code:
    Code:
    roctab prevdis nutritionstat if nutritionstat<10 & prevdis<10, table summary
    Here are the results:

    Click image for larger version

Name:	picstata.png
Views:	2
Size:	6.9 KB
ID:	1332552




    I'm unclear how this is even possible as I thought if the line goes below the curve the AUC compensates and also goes above 0.5 anyways. So for example if it is 0.46 like in this case then it would be 0.54. Maybe this is my misunderstanding then.

    Thanks for any help you can provide in advance!
    Attached Files

  • #2
    I'm unclear how this is even possible as I thought if the line goes below the curve the AUC compensates and also goes above 0.5 anyways.
    It is indeed your misunderstanding. Stata does not "flip" the data when the curve runs below the diagonal line. It reports the area less than 0.5. The substantive meaning is that your outcome is actually less likely with increasing values of your predictor. So you can either subtract the AUC you are getting from 1, or you can recode your predictors so that they take the opposite order.

    Comment

    Working...
    X