0
votes

I am looking to create a pdf with 4 nice graphs for different analysis. My question is, how do I output only the ROC curve for my logistic regression?

I use the following code

            TITLE2 JUSTIFY=CENTER "Rank ordering characteristic curve (ROC)"; 
            ODS GRAPHICS ON;
                PROC LOGISTIC 
                    DATA = input
                    plots(only)=(roc(id=obs))
            ;
            MODEL y
                (Event = '1')=  x   
                    /
                SELECTION=NONE
                LINK=LOGIT;
            RUN;
            QUIT;
            ODS GRAPHICS OFF;

and a dummy dataset can be imagined using this

DATA HAVE;
    DO I = 1 TO 100;
        Y = RAND('integer',0,1);
        x = ranuni(i);
        output;
    end;
run;

Thanks

EDIT: just to be explicit, I'm looking to output just a plot of the ROC curve and nothing else, i.e. the tables containing the somers' D etc.

1
Agree with Reeza's answer below. But if you want to make a more customized ROC curve, sometimes it's worth outputting the sensitivity/specificity values and making your own plot via SGPLOT or GTL.Quentin
also very valid, thank youleft_joins_are_for_cowards

1 Answers

1
votes
ODS SELECT ROCCURVE;

ODS SELECT allows you to control the output and include only the tables/output you want. You can wrap your code in ODS TRACE ON, ODS TRACE OFF to find out what the table name, or check the documentation.