Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Re: Sensitivity and Specificity Output for an ROC Curve

Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

🔒 This topic is **solved** and **locked**.
Need further help from the community? Please
sign in and ask a **new** question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 01-19-2021 09:49 AM
(990 views)

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!

1 ACCEPTED SOLUTION

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;
```

4 REPLIES 4

- 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

Thanks! That was exactly what I was looking for - to display the numerical

values.

values.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Then remove SEX from your model.

**SAS Innovate 2025** is scheduled for May 6-9 in Orlando, FL. Sign up to be **first to learn** about the agenda and registration!

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.