<?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 Industry-Year fixed effect Vs. Sorting by Industry year in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Industry-Year-fixed-effect-Vs-Sorting-by-Industry-year/m-p/742998#M232530</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="abdulla_0-1621619602308.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/59671i638995D63088C531/image-size/medium?v=v2&amp;amp;px=400" role="button" title="abdulla_0-1621619602308.png" alt="abdulla_0-1621619602308.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Eq. (1) is estimated for each industry-year with at least 20 observations.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The above is from a published paper. The goal is to calculate residuals. From the above, I understood that before running regression, we have to sort observations by industry and year and then run the regression.&amp;nbsp;&lt;/P&gt;&lt;P&gt;For that, I did the following&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc sort data=have;&lt;BR /&gt;by industry year ; Run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Proc reg data=have noprint;&lt;BR /&gt;by industry&amp;nbsp; year;&lt;BR /&gt;model Inv=sales_growth;&lt;BR /&gt;output out=want r=res;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, I wanted to verify whether this is similar to using industry- year fixed effect. I did the following&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc glm data=have noprint;&lt;BR /&gt;class Industry year;&lt;BR /&gt;model Inv = sales_growth industry year / solution;&lt;BR /&gt;output out=want r=res2;&lt;BR /&gt;run;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I checked the residuals, I found that they are different. I am not sure why? Why will we choose one vs the other? Which one is preferable and why, on the basis of econometric consideration? The paper has no explanation why they did what they did. Could anyone please suggest me anything or confirm that I am doing things correctly in the first regression? Or Am I making mistakes here?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 21 May 2021 18:42:08 GMT</pubDate>
    <dc:creator>abdulla</dc:creator>
    <dc:date>2021-05-21T18:42:08Z</dc:date>
    <item>
      <title>Industry-Year fixed effect Vs. Sorting by Industry year</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Industry-Year-fixed-effect-Vs-Sorting-by-Industry-year/m-p/742998#M232530</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="abdulla_0-1621619602308.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/59671i638995D63088C531/image-size/medium?v=v2&amp;amp;px=400" role="button" title="abdulla_0-1621619602308.png" alt="abdulla_0-1621619602308.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Eq. (1) is estimated for each industry-year with at least 20 observations.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The above is from a published paper. The goal is to calculate residuals. From the above, I understood that before running regression, we have to sort observations by industry and year and then run the regression.&amp;nbsp;&lt;/P&gt;&lt;P&gt;For that, I did the following&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc sort data=have;&lt;BR /&gt;by industry year ; Run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Proc reg data=have noprint;&lt;BR /&gt;by industry&amp;nbsp; year;&lt;BR /&gt;model Inv=sales_growth;&lt;BR /&gt;output out=want r=res;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, I wanted to verify whether this is similar to using industry- year fixed effect. I did the following&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc glm data=have noprint;&lt;BR /&gt;class Industry year;&lt;BR /&gt;model Inv = sales_growth industry year / solution;&lt;BR /&gt;output out=want r=res2;&lt;BR /&gt;run;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I checked the residuals, I found that they are different. I am not sure why? Why will we choose one vs the other? Which one is preferable and why, on the basis of econometric consideration? The paper has no explanation why they did what they did. Could anyone please suggest me anything or confirm that I am doing things correctly in the first regression? Or Am I making mistakes here?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 May 2021 18:42:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Industry-Year-fixed-effect-Vs-Sorting-by-Industry-year/m-p/742998#M232530</guid>
      <dc:creator>abdulla</dc:creator>
      <dc:date>2021-05-21T18:42:08Z</dc:date>
    </item>
    <item>
      <title>Re: Industry-Year fixed effect Vs. Sorting by Industry year</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Industry-Year-fixed-effect-Vs-Sorting-by-Industry-year/m-p/743125#M232584</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I haven't read it in detail, but I think your question is addressed in this blog:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The difference between CLASS statements and BY statements in SAS&lt;BR /&gt;By Rick Wicklin on The DO Loop February 14, 2018&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/iml/2018/02/14/difference-class-and-by-statements-sas.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2018/02/14/difference-class-and-by-statements-sas.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;There's a section:&lt;/P&gt;
&lt;P&gt;Predicted Values: CLASS VARIABLE versus BY Variable&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You would certainly have got an earlier response by posting this topic in 'Statistical Procedures' under the 'analytics' heading with a title like:&amp;nbsp;Industry-Year fixed effects Vs. separate models by Industry-Year.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Good luck,&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Sat, 22 May 2021 12:51:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Industry-Year-fixed-effect-Vs-Sorting-by-Industry-year/m-p/743125#M232584</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2021-05-22T12:51:39Z</dc:date>
    </item>
  </channel>
</rss>

