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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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
  • 1402 views
  • 1 like
  • 3 in conversation