BookmarkSubscribeRSS Feed
Teresa12
Calcite | Level 5


I need to create a ROC curve.

My data looks like :

data Data1;
input id score diagnosis;
datalines;
1 0.1 0
1 0.2 0
1 1.0 1
1 0.8 0
1 0.9 0
2 1.8 1
2 1.2 1
3 1.7 1
3 1.1 0
4 0.1 0
4 1.9 0
4 1.8 1
4 1.2 1
4 2.0 0
5 0.7 0
5 1.2 1

;

I have several tests per ID.
My sas code following

ods graphics on;
proc logistic data=data1 plots(only)=(roc(id=obs) effect) descending;
model diagnosis(event='1')=score / ctable outroc=RocStats ;
ROC; ROCCONTRAST;
run;
ods graphics off;

My question: I don't know how to integrate the repeated ID into my model.
I use only diagnosis and score. O am confused about this issue

Thanks:

3 REPLIES 3
gcjfernandez
SAS Employee

Unfortunately, Proc Logistic is not appropriate for generating ROC chart with repeated measures. You need to use GLIMMIX to account for repeated measures. But there is no option available in GLIMMIX to generate ROC chart. Please check this paper where the author has included a SAS macro for generating ROC using SAS IML.

 http://ferran.torres.name/download/shared/roc/roc.pdf.

 

StatDave
SAS Super FREQ

You can use the predicted probabilities from any model on a binary response in PROC LOGISTIC to generate an ROC curve. See this note. If you want to use a GEE model to handle the repeated measures allowing an exchangeable correlation matrix, then you could use these statements.

proc gee data=data1;
class id;
model diagnosis(event='1')=score / dist=bin ;
repeated subject=id / type=exch;
output out=out p=p;
run;
proc logistic data=out;
model diagnosis(event="1")= / nofit;
roc pred=p;
run;
Teresa12
Calcite | Level 5

Thank you very much for your answer!!!

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
  • 3 replies
  • 905 views
  • 6 likes
  • 3 in conversation