turn on suggestions

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

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Weight and proc logistic

Topic Options

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

05-10-2017 06:08 AM

ods graphics on; proc logistic data=sample outmodel = model_output plots(only)=roc; model target(event = "1") = var1--var20; weight w; run; ods graphics off;

where w = 1 or 0;

Hello, if I run the above code, I'm hoping I'll fit a model based on the data where my weight variable is 1 and the output statistics will be where my weight variable is 0?

Will the roc plot include all my data or just where w = 1?

Thanks

Accepted Solutions

Solution

3 weeks ago

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Rhys

05-10-2017 07:19 AM - edited 05-10-2017 07:23 AM

Any observation that has weight=0 is excluded from the model and is not used in the fitting. If you use an output statement such as

output out=out prob=prob resdev=resdev xbeta=xbeta;

then some statistics (such as PROB and XBETA) will be present for all observations, regardless of the weight value.

However, residuals (such as RESDEV), which depend on having a response value, will have missing values when weight=0 because those responses are not part of the data that were used to fit the model.

The ROC curve is composed of the points for which weight is NOT zero. You can use the OUTROC= option on the MODEL statement to see the points used in the ROC curve.

All Replies

Solution

3 weeks ago

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Rhys

05-10-2017 07:19 AM - edited 05-10-2017 07:23 AM

Any observation that has weight=0 is excluded from the model and is not used in the fitting. If you use an output statement such as

output out=out prob=prob resdev=resdev xbeta=xbeta;

then some statistics (such as PROB and XBETA) will be present for all observations, regardless of the weight value.

However, residuals (such as RESDEV), which depend on having a response value, will have missing values when weight=0 because those responses are not part of the data that were used to fit the model.

The ROC curve is composed of the points for which weight is NOT zero. You can use the OUTROC= option on the MODEL statement to see the points used in the ROC curve.