I am using data from PRAMS (which uses a complex survey design) to create an ROC curve using predicted probabilities. How can I see the sensitivity and specificity for my various cutoffs, keeping in mind the complex sample?
Thanks!
The ROC curve IS the set of sensitivities and specificities. I assume when you say, "how can I see them," you mean you want to display the actual numerical values along the curve? If so, you can do this by using ODS OUTPUT.
For example, if you were using PROC LOGISTIC, it might look like this:
ods trace on;
proc logistic data=Data1 plots(only)=roc;
model disease/n=age;
ods output ROCCurve=OutROC;
run;
data OutROC2;
set OutROC;
Specificity = 1 - _1MSPEC_;
run;
proc print data=OutROC2 label;
var _SENSIT_ _1MSPEC_ Specificity;
run;
The ROC curve IS the set of sensitivities and specificities. I assume when you say, "how can I see them," you mean you want to display the actual numerical values along the curve? If so, you can do this by using ODS OUTPUT.
For example, if you were using PROC LOGISTIC, it might look like this:
ods trace on;
proc logistic data=Data1 plots(only)=roc;
model disease/n=age;
ods output ROCCurve=OutROC;
run;
data OutROC2;
set OutROC;
Specificity = 1 - _1MSPEC_;
run;
proc print data=OutROC2 label;
var _SENSIT_ _1MSPEC_ Specificity;
run;
One follow up question - I am trying to get the sensitivity and specificity for each of my exposure groups independent of the covariates I have included in the model. For example, my exposure variable is smoking (4 levels), and I have included the covariate sex in my model (2 levels). Right now, I get sensitivities and specificities for each combination of the smoking groups and sex (8 different sensitivities). I would just like to see sensitivity and specificity for each level of the exposure group (smoking), independent of sex.
Then remove SEX from your model.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.