<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: PROC REG - RESTRICTIONS in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/PROC-REG-RESTRICTIONS/m-p/568209#M27975</link>
    <description>&lt;P&gt;There is no way to restrict the predicted value in PROC REG. The predictions are determined by least squares regression.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are getting negative predicted values, then you need to examine other options. For example, the regression fit might be influenced by one or more outliers or high-leverage points that are pulling the regression line up or down. If so, you might try PROC ROBUSTREG for robust regression.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I also like Peter's suggestion. However, instead of performing an OLS fit of LOG(Y) and then taking EXP of the predicted values, you could use PROC GENMOD to fit a log-link model. For a discussion of the two models and why they are different, see &lt;A href="https://blogs.sas.com/content/iml/2015/09/16/plot-distrib-exp.html" target="_self"&gt;"Error distributions and exponential regression models."&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 23 Jun 2019 12:11:46 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2019-06-23T12:11:46Z</dc:date>
    <item>
      <title>PROC REG - RESTRICTIONS</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/PROC-REG-RESTRICTIONS/m-p/568184#M27967</link>
      <description>&lt;P&gt;I want to run linear regression, but I have to add the next restriction&amp;nbsp; : yhat&amp;gt;=0, i.e predicted variable have to be greater or equal to zero. I use proc reg. if I cannot use it, maybe SAS has another procedure that can do it.&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Sun, 23 Jun 2019 04:42:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/PROC-REG-RESTRICTIONS/m-p/568184#M27967</guid>
      <dc:creator>AlexeyS</dc:creator>
      <dc:date>2019-06-23T04:42:37Z</dc:date>
    </item>
    <item>
      <title>Re: PROC REG - RESTRICTIONS</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/PROC-REG-RESTRICTIONS/m-p/568196#M27968</link>
      <description>&lt;P&gt;Please tell us more about your problem. In particular:&lt;/P&gt;
&lt;P&gt;1. Is the response variable an inherently positive quantity such as a count, a volume, or a weight? If it is a count, you might consider using PROC GENMOD and Poisson regression.&lt;/P&gt;
&lt;P&gt;2. Are all of the observed responses positive? If so, the predicted values will also be positive on &lt;A href="https://blogs.sas.com/content/iml/2019/03/18/interpolation-extrapolation-convex-hull.html" target="_self"&gt;the convex hull of the observations&lt;/A&gt;. For an example, see the article &lt;A href="https://blogs.sas.com/content/iml/2019/03/20/truncate-response-surfaces.html" target="_self"&gt;"Truncate response surfaces."&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 23 Jun 2019 10:14:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/PROC-REG-RESTRICTIONS/m-p/568196#M27968</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2019-06-23T10:14:31Z</dc:date>
    </item>
    <item>
      <title>Re: PROC REG - RESTRICTIONS</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/PROC-REG-RESTRICTIONS/m-p/568200#M27969</link>
      <description>&lt;P&gt;Why do you want to restrict the predicted values to positive numbers?&lt;/P&gt;&lt;P&gt;What is the nature of your dependent variable?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the DV is a count, then there is PROC COUNTREG which lets you do Poisson regression or negative binomial regression (I have never had a case where the assumptions of Poisson are valid - they may exist, but it may be as unlikely as a cavalry officer getting kicked to death by his horse. COUNTREG offers other options too.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the DV is bounded on both ends (not just the low end at 0) then beta regression could work (you may have to divide the DV by its max value).&amp;nbsp; You can do this in PROC GLIMMIX using the DIST = beta option on the model statement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If neither of those are the case, you could try taking the log of the DV and then back transforming after the regression - but I don't necessarily recommend this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 23 Jun 2019 10:48:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/PROC-REG-RESTRICTIONS/m-p/568200#M27969</guid>
      <dc:creator>plf515</dc:creator>
      <dc:date>2019-06-23T10:48:27Z</dc:date>
    </item>
    <item>
      <title>Re: PROC REG - RESTRICTIONS</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/PROC-REG-RESTRICTIONS/m-p/568203#M27971</link>
      <description>&lt;P&gt;My predicted dependent variable should be&amp;nbsp;greater or equal to&amp;nbsp;zero. It's like volume. I use proc reg, and didn't find an option to restrict yhat be ge zero&lt;/P&gt;</description>
      <pubDate>Sun, 23 Jun 2019 11:00:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/PROC-REG-RESTRICTIONS/m-p/568203#M27971</guid>
      <dc:creator>AlexeyS</dc:creator>
      <dc:date>2019-06-23T11:00:20Z</dc:date>
    </item>
    <item>
      <title>Re: PROC REG - RESTRICTIONS</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/PROC-REG-RESTRICTIONS/m-p/568204#M27972</link>
      <description>&lt;P&gt;My dependent variable is greater or equal to zero. I want that predicted DV will be the same.&amp;nbsp;My variable looks like volume. I use proc reg but I saw that this procedure don't have an option to restrict predicted value of DV.&lt;/P&gt;</description>
      <pubDate>Sun, 23 Jun 2019 11:02:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/PROC-REG-RESTRICTIONS/m-p/568204#M27972</guid>
      <dc:creator>AlexeyS</dc:creator>
      <dc:date>2019-06-23T11:02:16Z</dc:date>
    </item>
    <item>
      <title>Re: PROC REG - RESTRICTIONS</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/PROC-REG-RESTRICTIONS/m-p/568206#M27974</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/42503"&gt;@AlexeyS&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;My predicted dependent variable should be&amp;nbsp;greater or equal to&amp;nbsp;zero. It's like volume. I use proc reg, and didn't find an option to restrict yhat be ge zero&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;It seems to me that &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt; has already provided the solution. If it doesn't work in your case, please give specific and detailed information about why it doesn't work.&lt;/P&gt;</description>
      <pubDate>Sun, 23 Jun 2019 11:15:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/PROC-REG-RESTRICTIONS/m-p/568206#M27974</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-06-23T11:15:42Z</dc:date>
    </item>
    <item>
      <title>Re: PROC REG - RESTRICTIONS</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/PROC-REG-RESTRICTIONS/m-p/568209#M27975</link>
      <description>&lt;P&gt;There is no way to restrict the predicted value in PROC REG. The predictions are determined by least squares regression.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are getting negative predicted values, then you need to examine other options. For example, the regression fit might be influenced by one or more outliers or high-leverage points that are pulling the regression line up or down. If so, you might try PROC ROBUSTREG for robust regression.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I also like Peter's suggestion. However, instead of performing an OLS fit of LOG(Y) and then taking EXP of the predicted values, you could use PROC GENMOD to fit a log-link model. For a discussion of the two models and why they are different, see &lt;A href="https://blogs.sas.com/content/iml/2015/09/16/plot-distrib-exp.html" target="_self"&gt;"Error distributions and exponential regression models."&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 23 Jun 2019 12:11:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/PROC-REG-RESTRICTIONS/m-p/568209#M27975</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2019-06-23T12:11:46Z</dc:date>
    </item>
    <item>
      <title>Re: PROC REG - RESTRICTIONS</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/PROC-REG-RESTRICTIONS/m-p/568212#M27976</link>
      <description>&lt;P&gt;I am not sure, you could try other distribution and LINKED function.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc genmod data=sashelp.class;
model weight=height/dist=gamma link=log;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 23 Jun 2019 12:37:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/PROC-REG-RESTRICTIONS/m-p/568212#M27976</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2019-06-23T12:37:59Z</dc:date>
    </item>
  </channel>
</rss>

