You have two independent samples (men and women), and want to compare the ROC curves calculated from each sample. As I understand it from http://support.sas.com/kb/45/339.html , SAS cannot compare ROC curves from independent samples in one PROC step. You have to do the work yourself.
The process is:
- Run PROC LOGISTIC to compute the ROC statistics (sensitivity/specificity at each cut point) and AUCs with standard errors, for each sample.
- Build a plot of the ROC statistics, overlaying the two curves.
- Compute a test statistic and p-value from the AUCs.
Below is my attempt at an example. I'm not promising this is correct, but it's my implementation of my understanding of the information in the support note. Please read the support note.
Sample data. I still don't understand your data, so I made some that I do understand. Data for 5 females and 6 males. Each person has a score on some diagnostic test, and a disease status (1/0).
data have;
input Sex $1. Test Disease;
cards;
F 10 0
F 20 0
F 30 1
F 40 0
F 50 1
M 10 0
M 20 1
M 30 0
M 40 1
M 50 1
M 60 1
;
run;
Run PROC logistic, and output the statistics. I used a BY statement rather than running separate PROC steps for males and females.
ods output ROCassociation=AUCs(where=(ROCmodel="Test"));
proc logistic data=have plots(only)=roc;
model Disease(event='1') = Test
/outroc=RocStats(where=(_source_="Test"))
;
roc 'Test' Test;
by Sex;
run;
ods output close;
Use SGPLOT to plot the overlaid ROC curves. I'm using 9.3 so need to use ODS graphics statement to force a square plot. 9.4 introduced aspect=1 option to SGPLOT. It's a straight-forward plot, reminds me how much I love SGPLOT and GTL. I don't think I'll ever go back to GPLOT.
ods graphics / height=480px width=480px;
proc sgplot data=RocStats;
xaxis values=(0 to 1 by 0.25) grid offsetmin=.05 offsetmax=.05;
yaxis values=(0 to 1 by 0.25) grid offsetmin=.05 offsetmax=.05;
lineparm x=0 y=0 slope=1 / transparency=.7;
series x=_1mspec_ y=_sensit_ / group=Sex;
run;
Compute the test statistics. The support note said this is a large-sample test. The test statistic follows chi-square distribution with 1 degree of freedom.
data AUCtest(keep=AreaMale StdErrMale AreaFemale StdErrFemale ChiSq Prob);
set AUCs (keep=Sex Area StdErr
where=(Sex='M')
rename=(Area=AreaMale StdErr=StdErrMale)
)
;
set AUCs (keep=Sex Area StdErr
where=(Sex='F')
rename=(Area=AreaFemale StdErr=StdErrFemale)
)
;
ChiSq=(AreaMale-AreaFemale)**2/(StdErrMale**2 + StdErrFemale**2);
Prob=1-probChi(ChiSq,1);
format Prob pvalue6.;
run;
Again, don't take any of this as truth. Use at your own risk, I'm in the learning phase also.