BookmarkSubscribeRSS Feed
kthartma
Fluorite | Level 6

Hi everyone, 

 

New to SAS and looking for some guidance. 

 

I have the following variables: volumes, my outcome and my predictor in a data file. 

e.g.

Volume group     Volume        Outcome     Predictor

<500                       100                  0            1

<500                       255                  0            0

500-<1000              789                  1            1

 

I've created a ROC curve for my outcome and predictor, but I want to have multiple curves by my volume groups (e.g. <500, 500-<1000, >=1000). Wondering if this is this possible? Here is my code so far. 

 

ods graphics on;

proc logistic data=test plots=effects plots=roc;

model outcome=predictor;

run;

ods graphics off;

 

2 REPLIES 2
ChrisNZ
Tourmaline | Level 20

you could create a format:

proc format ; 
  value age 10-14='A' 15-20='B';
run;
proc sort data=SASHELP.CLASS out=CLASS; 
 by AGE;
run;

ods graphics on;
proc logistic data=CLASS plots=effect plots=roc;
  by AGE;
  format AGE age.;
  model HEIGHT=WEIGHT;
run;
ods graphics off;  

 

Rick_SAS
SAS Super FREQ

As ChrisNZ shows, you can sort the data by your 'Volume group' variable and use a BY statement if you want to create separate ROC curves,

 

You do not state how you obtained the predicted values, but because your volume appears to be a covariate, you might instead choose to incorporate that information into the model. Then the Predictor variable would use the volume as part of the predictive model.

 

Lastly, since you already have the Predictor variable and you just want the ROC curve, you should add the NOFIT option to the MODEL statement and use an ROC statement to get the plot:

ROC 'My Curve' pred=Predictor;

 

SAS Innovate 2025: Call for Content

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!

Submit your idea!

What is ANOVA?

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.

Discussion stats
  • 2 replies
  • 1629 views
  • 1 like
  • 3 in conversation