- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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:
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thank you very much for your answer!!!