ods graphics on;
proc logistic data=change desc plots(only)=roc;
class actual;
units age=10;
model test(event="Yes")= actual age/outroc=x scale=none clparm=wald clodds=pl rsquare;
run;
quit;
ods graphics off;
/*I have written this code, is it a correct approach?*/
The actual response (which I assume is binary like your test variable) should be the response variable in the MODEL, not the test variable. Note that without age, your test and actual variables would just produce a 2x2 table if they are both binary. As such, an ROC curve would only have one point on it, so it wouldn't be useful. With age in the model, you'll get as many points on the ROC curve as age levels, but the curve evaluates your test and age variables together, not just the test variable alone.
Note you don't need the DESCENDING option if you are using EVENT=.
The actual response (which I assume is binary like your test variable) should be the response variable in the MODEL, not the test variable. Note that without age, your test and actual variables would just produce a 2x2 table if they are both binary. As such, an ROC curve would only have one point on it, so it wouldn't be useful. With age in the model, you'll get as many points on the ROC curve as age levels, but the curve evaluates your test and age variables together, not just the test variable alone.
Note you don't need the DESCENDING option if you are using EVENT=.
Thank You
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.