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
- /
- Capping predictions using SAS/STAT prodecures

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

02-14-2017 10:16 AM

Is there a way in SAS regression procedures to cap lower bound of predicted values.

I would like to know if there is a way or option that can be used to adjust that in the procedure itself.

I have a scenario in which predicted negative values would practically never happen and I want to adjust that in regression itself.

Please let me know if anyone knows a way to handle that.

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

Posted in reply to ArseneWenger

02-14-2017 10:33 AM

You might mention which specific regression procedures you are using. It won't help you much if someone comes back with a technique that only works in one or two procedures and those are not the regressions you are using.

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

Posted in reply to ballardw

02-14-2017 10:54 AM

I am using Proc Reg right now but couldn't find any option to cap. Are there any other regression procedure that does that?

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

Posted in reply to ArseneWenger

02-14-2017 10:39 AM

The general technique is to choose an appropriate model for the response. For example, if the response is a nonnegative count, use Poisson regression. If you are using a linear model such as OLS, then the model will produce negative values when the data call for it.

For a continuous response, you can use a LOG link function to prevent negative predictions, but realize that you are changing the model.

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

Posted in reply to ArseneWenger

02-14-2017 01:15 PM

To answer your question: no, I do not believe that SAS supports any option that truncates the predicted values.

Truncating predictions like that would not fit an OLS model.

I think the right thing to do is choose a model that makes sense for your data. Can you describe your data and the problem that you are trying to solve?

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

Posted in reply to ArseneWenger

02-14-2017 01:41 PM

Generally I would output the predicted values and then post process the results in a data step as needed. I do this with confidence limit predictions on a regular basis. My data is proportion and one of the limits sometimes exceeds the [0%,100%] range that makes sense. Since I do this fairly frequently I have a custom format to force values less than 0 to display as 0 and greater than 100 as 100.

With a format I could even include an explanatory symbol to indicate a truncated result to let readers know.

If the value needs to be used in further calculations than the data step boundary would be see with something like:

if pred<0 then pred=0;

else if pred>(some maximum value) then pred=(maximum value).

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

Posted in reply to ballardw

02-14-2017 03:10 PM

IMHO, there is a big difference between adjusting confidence limits (which are probably based derived from an asymptotic normal theory) and adjusting predicted values. If you adjust the predicted values, the model is no longer linear; it becomes piecewise linear (or worse?)

If you don't want to move to a generalized linear model, at least consider whether you can use the NOINT option or RESTRICT statement to restrict the intercept term.

Good luck!