<?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: Fixed effect regressions in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Fixed-effect-regressions/m-p/411996#M21595</link>
    <description>&lt;P&gt;Paul Allison has a wonderful book on fitting fixed effects models of various types - ordinary regression (normal response), logistic, Poisson, and survival (Cox) models. Here is the reference and a link to it:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.sas.com/store/books/categories/usage-and-reference/fixed-effects-regression-methods-for-longitudinal-data-using-sas-/prodBK_58348_en.html" target="_self"&gt;Fixed Effects Regression Methods for Longitudinal Data Using SAS&lt;/A&gt; (Allison, P., SAS Institute, 2005)&lt;/P&gt;</description>
    <pubDate>Thu, 09 Nov 2017 16:28:41 GMT</pubDate>
    <dc:creator>StatDave</dc:creator>
    <dc:date>2017-11-09T16:28:41Z</dc:date>
    <item>
      <title>Fixed effect regressions</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Fixed-effect-regressions/m-p/171442#M21493</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to run a regression between annual expense and sales, including a fixed effect for each firm (firm_code).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I came across the codes:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE style="color: #000000;"&gt;
&lt;P&gt;proc glm; &lt;/P&gt;
&lt;P&gt;absorb firm_code; &lt;/P&gt;
&lt;P&gt;model expense = sales / solution noint; &lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;quit; &lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I am using a panel data including 4 years of observations for each firm. This means for each firm (firm_code) there will be four observations of expense and sales.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As a result, I only need to create on dummy variable for each firm, I am not sure whether the command "absorb" does that, or does it create a dummy variable for every line of observation for firm? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If there is any better ways of running fixed effects regression, please tell me &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Aug 2014 06:28:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Fixed-effect-regressions/m-p/171442#M21493</guid>
      <dc:creator>miguel_valero</dc:creator>
      <dc:date>2014-08-22T06:28:45Z</dc:date>
    </item>
    <item>
      <title>Re: Fixed effect regressions</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Fixed-effect-regressions/m-p/171443#M21494</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually, you don't have to create a dummy variable for each firm, just be certain that the dataset is sorted by firm_code.&amp;nbsp; GLM will automatically nest the observations within firm_code, and perform the regression.&amp;nbsp; And provided you don't need predicted values or regression diagnostics, you get all this with a marked reduction in overhead computational resources.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now if you want a regression for EACH firm_code (sort of implied in the first line of your post), either a BY statement or something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc glm;&lt;/P&gt;&lt;P&gt;class firm_code;&lt;/P&gt;&lt;P&gt;model model expense = sales|firm_code / solution noint;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This would give separate intercepts and slopes for each firm_code, but assumes common residual variance across firm_codes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve Denham&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Steve Denham&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Aug 2014 12:53:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Fixed-effect-regressions/m-p/171443#M21494</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2014-08-22T12:53:45Z</dc:date>
    </item>
    <item>
      <title>Re: Fixed effect regressions</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Fixed-effect-regressions/m-p/171444#M21495</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Steve,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry for the misunderstanding. I have a panel of annual data for different firms over several years of time. I just need to run &lt;STRONG&gt;one&lt;/STRONG&gt; regression for the entire panel. However, I do need to control for firm fixed effect for each individual firm (presumably by adding a dummy variable for each firm - e.g. dummy A equals to 1 for firm A 2010, 2011, and 2012).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Aug 2014 22:29:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Fixed-effect-regressions/m-p/171444#M21495</guid>
      <dc:creator>miguel_valero</dc:creator>
      <dc:date>2014-08-22T22:29:51Z</dc:date>
    </item>
    <item>
      <title>Re: Fixed effect regressions</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Fixed-effect-regressions/m-p/171445#M21496</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Then ABSORB looks like your best tool to accomplish that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve Denham&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Aug 2014 11:34:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Fixed-effect-regressions/m-p/171445#M21496</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2014-08-25T11:34:25Z</dc:date>
    </item>
    <item>
      <title>Re: Fixed effect regressions</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Fixed-effect-regressions/m-p/410732#M21497</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15363"&gt;@SteveDenham&lt;/a&gt;Currently I am doing exactly what you have mentioned. I am trying to run fixed effect regression. In first step I need to run regression on every firm-year (each year of each firm individually) and then using the intercept of that regression in second regression.&lt;BR /&gt;&lt;BR /&gt;I tried to run your code:&lt;/P&gt;&lt;P&gt;proc glm;&lt;/P&gt;&lt;P&gt;class firm_code;&lt;/P&gt;&lt;P&gt;model model expense = sales|firm_code / solution noint;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I guess writing model two times was unintentional. So I change you codes as follow;&lt;/P&gt;&lt;P&gt;proc glm data=dtab2;&lt;BR /&gt;class count; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;EM&gt;* where count is unique number for each firm year;&lt;/EM&gt;&lt;BR /&gt;model exret = Mktrf | count / solution noint; &amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;EM&gt;*where exret=excess return, Mktrf=Market return;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;output out=xglm p=predicted;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;Results show this error&lt;/P&gt;&lt;P&gt;ERROR: Number of levels for some effects &amp;gt; 32767.&lt;/P&gt;&lt;P&gt;Also I tried to run proc reg/proc panel/proc tscs/ but the problem is:&lt;/P&gt;&lt;P&gt;if I don't specify by variable, I get reg output of whole model as one (row) observation having intercept and coefficient for all firms&lt;/P&gt;&lt;P&gt;if I specify by variable for both time series (macc=unique for each time obs) and cross-sectional (permno) variable, it seems my model is over specified,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;gt;proc reg give infinite error for each firm-year (number of nonmissing values are ....)&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;gt;proc panel give error (Event Stack Underflow caused by mis-matched begin and end event call in SAS)&lt;/P&gt;&lt;P&gt;if I reg by count(proc reg data=dtab2 outest=xreg noprint; by count; model exret = Mktrf / adjrsq; quit;) then beta &amp;amp; RMSE ave no values and intercept are generated exactly of similar value as exret (dep variable) itself.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kindly suggest me any solution to this problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2017 00:38:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Fixed-effect-regressions/m-p/410732#M21497</guid>
      <dc:creator>omer2020</dc:creator>
      <dc:date>2017-11-06T00:38:05Z</dc:date>
    </item>
    <item>
      <title>Re: Fixed effect regressions</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Fixed-effect-regressions/m-p/411996#M21595</link>
      <description>&lt;P&gt;Paul Allison has a wonderful book on fitting fixed effects models of various types - ordinary regression (normal response), logistic, Poisson, and survival (Cox) models. Here is the reference and a link to it:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.sas.com/store/books/categories/usage-and-reference/fixed-effects-regression-methods-for-longitudinal-data-using-sas-/prodBK_58348_en.html" target="_self"&gt;Fixed Effects Regression Methods for Longitudinal Data Using SAS&lt;/A&gt; (Allison, P., SAS Institute, 2005)&lt;/P&gt;</description>
      <pubDate>Thu, 09 Nov 2017 16:28:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Fixed-effect-regressions/m-p/411996#M21595</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2017-11-09T16:28:41Z</dc:date>
    </item>
  </channel>
</rss>

