- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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!
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Find the name of the ROC graph for which you want the values
- Use ODS OUTPUT to write the graph to a SAS data set
- Use PROC PRINT to display the results
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;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Find the name of the ROC graph for which you want the values
- Use ODS OUTPUT to write the graph to a SAS data set
- Use PROC PRINT to display the results
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;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
values.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Then remove SEX from your model.