<?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: Outputting Residual values with BY statement in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Outputting-Residual-values-with-BY-statement/m-p/645988#M30992</link>
    <description>&lt;P&gt;Works for me. Show us (a portion of) the output data set named RESID so we can see what you are seeing.&lt;/P&gt;</description>
    <pubDate>Thu, 07 May 2020 18:16:54 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2020-05-07T18:16:54Z</dc:date>
    <item>
      <title>Outputting Residual values with BY statement</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Outputting-Residual-values-with-BY-statement/m-p/645985#M30991</link>
      <description>&lt;P&gt;I am running a regression model with a BY statement, where individual regression models are run for each group.&amp;nbsp; I want the residual values which are stored in the output dataset to be for the regression model of the applicable group for each observation.&amp;nbsp; I thought that just by placing the BY statement before the output statement would do this, but after looking at the residual values that doesn't appear to be the case.&amp;nbsp; Is there a way to do this within the PROC REG procedure or will separate output groups have to be concatenated?&amp;nbsp; If the latter is the case, how do I get an output table for each model?&amp;nbsp; Here is how I wrote my code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;proc reg data=MY_DATA ;
model  Y_VAR = X_VAR/r ;
by GRP_NAME;
output out=resid
r=yresid 
cookd=cooks;
run;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 May 2020 18:11:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Outputting-Residual-values-with-BY-statement/m-p/645985#M30991</guid>
      <dc:creator>RandoDando</dc:creator>
      <dc:date>2020-05-07T18:11:53Z</dc:date>
    </item>
    <item>
      <title>Re: Outputting Residual values with BY statement</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Outputting-Residual-values-with-BY-statement/m-p/645988#M30992</link>
      <description>&lt;P&gt;Works for me. Show us (a portion of) the output data set named RESID so we can see what you are seeing.&lt;/P&gt;</description>
      <pubDate>Thu, 07 May 2020 18:16:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Outputting-Residual-values-with-BY-statement/m-p/645988#M30992</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-05-07T18:16:54Z</dc:date>
    </item>
    <item>
      <title>Re: Outputting Residual values with BY statement</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Outputting-Residual-values-with-BY-statement/m-p/645998#M30993</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp; After I sent this question, I ran PROC REG on 1 group, then output that as RESID1.&amp;nbsp; I then merged that with the applicable subset of RESID by ID and compared the residual values.&amp;nbsp; They matched.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A couple of the groups have higher than expected residuals for some cases, and that is what threw me off at first.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 May 2020 18:51:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Outputting-Residual-values-with-BY-statement/m-p/645998#M30993</guid>
      <dc:creator>RandoDando</dc:creator>
      <dc:date>2020-05-07T18:51:48Z</dc:date>
    </item>
    <item>
      <title>Re: Outputting Residual values with BY statement</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Outputting-Residual-values-with-BY-statement/m-p/646003#M30994</link>
      <description>REG needs a QUIT at the end because it can be interactive.</description>
      <pubDate>Thu, 07 May 2020 19:03:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Outputting-Residual-values-with-BY-statement/m-p/646003#M30994</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-05-07T19:03:04Z</dc:date>
    </item>
  </channel>
</rss>

