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
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.