<?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 effects with cluster in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Fixed-effects-with-cluster/m-p/480320#M24980</link>
    <description>&lt;P&gt;Dear Zard,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your comprehensive explanation. But I think when we use "Proc Mixed", it cannot absorb fixed effects by firm and fix cluster standard errors by date. It absorbs fixed effects and fix cluster standard errors of the same variable. Do you know any other methods than "Proc Surveyreg" which enables to do that?&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 23 Jul 2018 02:12:39 GMT</pubDate>
    <dc:creator>khorram</dc:creator>
    <dc:date>2018-07-23T02:12:39Z</dc:date>
    <item>
      <title>Fixed effects with cluster</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Fixed-effects-with-cluster/m-p/428211#M22498</link>
      <description>&lt;P&gt;I have a large panel data that contains daily stock returns and would like to run some fixed effect regressions with clustering at stock and month level.&lt;/P&gt;&lt;P&gt;I used PROC SURVEYREG as below but got a "ERROR: Integer overflow on computing amount of memory required". This is probably due to too many stocks. What would be another more efficient method to tackle this?&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc surveyreg data=prices; 
    clustered stock date;
    class stock; 
    model y=x1 x2 x3 x4 x5 x6 stock/solution; 
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2018 23:25:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Fixed-effects-with-cluster/m-p/428211#M22498</guid>
      <dc:creator>somebody</dc:creator>
      <dc:date>2018-01-16T23:25:26Z</dc:date>
    </item>
    <item>
      <title>Re: Fixed effects with cluster</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Fixed-effects-with-cluster/m-p/430135#M22613</link>
      <description>&lt;P&gt;&lt;FONT color="#000000" face="Segoe UI" size="3"&gt;PROC SURVEYREG will have memory issues when there are a large number of cluster levels and the clusters are also included in the model. There are several procedures that handle clustered standard errors, and SURVEYREG might not be the best one for this model.&lt;BR /&gt;&lt;BR /&gt;You could account clustering in a modeling procedure such as PROC MIXED (for normal response data) or PROC GENMOD (for binomial, count, and other response distributions).&amp;nbsp;PROC MIXED adjusts the standard errors for the fixed effects when you have a RANDOM statement in the model.&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="csBC719D4E"&gt;&lt;FONT color="#000000" face="Segoe UI" size="3"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="csBC719D4E"&gt;&lt;FONT color="#000000" face="Segoe UI" size="3"&gt;In the one-way case, say you have correlated data of firm-year observations, and you want to control for fixed effects at the year and industry level but compute clustered standard errors clustered at the firm level (could be firm, school, etc.). The PROC MIXED code would be&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="csBC719D4E"&gt;&lt;FONT color="#000000" face="Segoe UI" size="3"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="csBC719D4E"&gt;&lt;FONT color="#000000" face="Segoe UI" size="3"&gt;proc mixed empirical;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="csBC719D4E"&gt;&lt;FONT color="#000000" face="Segoe UI" size="3"&gt;&amp;nbsp; class firm;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="csBC719D4E"&gt;&lt;FONT color="#000000" face="Segoe UI" size="3"&gt;&amp;nbsp; model y = x1 x2 x3 / solution;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="csBC719D4E"&gt;&lt;FONT color="#000000" face="Segoe UI" size="3"&gt;&amp;nbsp; random int / subject=firm;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="csBC719D4E"&gt;&lt;FONT color="#000000" face="Segoe UI" size="3"&gt;run;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="csBC719D4E"&gt;&lt;FONT color="#000000" face="Segoe UI" size="3"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="csBC719D4E"&gt;&lt;FONT color="#000000" face="Segoe UI" size="3"&gt;With the MIXED code, you are estimating the model&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="csBC719D4E"&gt;&lt;FONT color="#000000" face="Segoe UI" size="3"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;FONT color="#000000"&gt;&lt;FONT face="Segoe UI"&gt;&lt;SPAN class="csBC719D4E"&gt;&lt;FONT size="3"&gt;&amp;nbsp; Y&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class="csBC719D4E"&gt;&lt;SUB&gt;&lt;FONT size="2"&gt;ij&lt;/FONT&gt;&lt;/SUB&gt;&lt;/SPAN&gt;&lt;SPAN class="csBC719D4E"&gt;&lt;FONT size="3"&gt; = U + B&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class="csBC719D4E"&gt;&lt;SUB&gt;&lt;FONT size="2"&gt;1&lt;/FONT&gt;&lt;/SUB&gt;&lt;/SPAN&gt;&lt;SPAN class="csBC719D4E"&gt;&lt;FONT size="3"&gt;*X&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class="csBC719D4E"&gt;&lt;SUB&gt;&lt;FONT size="2"&gt;1&lt;/FONT&gt;&lt;/SUB&gt;&lt;/SPAN&gt;&lt;SPAN class="csBC719D4E"&gt;&lt;FONT size="3"&gt; + B&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class="csBC719D4E"&gt;&lt;SUB&gt;&lt;FONT size="2"&gt;2&lt;/FONT&gt;&lt;/SUB&gt;&lt;/SPAN&gt;&lt;SPAN class="csBC719D4E"&gt;&lt;FONT size="3"&gt;*X&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class="csBC719D4E"&gt;&lt;SUB&gt;&lt;FONT size="2"&gt;2&lt;/FONT&gt;&lt;/SUB&gt;&lt;/SPAN&gt;&lt;SPAN class="csBC719D4E"&gt;&lt;FONT size="3"&gt; + F&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class="csBC719D4E"&gt;&lt;SUB&gt;&lt;FONT size="2"&gt;i&lt;/FONT&gt;&lt;/SUB&gt;&lt;/SPAN&gt;&lt;SPAN class="csBC719D4E"&gt;&lt;FONT size="3"&gt; + E&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class="csBC719D4E"&gt;&lt;SUB&gt;&lt;FONT size="2"&gt;ij&lt;/FONT&gt;&lt;/SUB&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="csBC719D4E"&gt;&lt;FONT color="#000000" face="Segoe UI" size="3"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;FONT color="#000000"&gt;&lt;FONT face="Segoe UI"&gt;&lt;SPAN class="csBC719D4E"&gt;&lt;FONT size="3"&gt;where the F&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class="csBC719D4E"&gt;&lt;SUB&gt;&lt;FONT size="2"&gt;i&lt;/FONT&gt;&lt;/SUB&gt;&lt;/SPAN&gt;&lt;SPAN class="csBC719D4E"&gt;&lt;FONT size="3"&gt;'s are the firm effects, assumed to come from a normal distribution with mean 0 and variance SIGMA_FIRM**2, and the E&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class="csBC719D4E"&gt;&lt;SUB&gt;&lt;FONT size="2"&gt;ij&lt;/FONT&gt;&lt;/SUB&gt;&lt;/SPAN&gt;&lt;SPAN class="csBC719D4E"&gt;&lt;FONT size="3"&gt;'s are the residuals. MIXED estimates the SIGMA_FIRM**2 and the variance of the residuals, using those estimates to adjust the standard errors of the regressors.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="csBC719D4E"&gt;&lt;FONT color="#000000" face="Segoe UI" size="3"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="csBC719D4E"&gt;&lt;FONT color="#000000" face="Segoe UI" size="3"&gt;You can further adjust the mixed model using the EMPIRICAL option on the PROC MIXED statement to get empirical-based standard errors for the fixed effects.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="csBC719D4E"&gt;&lt;FONT color="#000000" face="Segoe UI" size="3"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="csBC719D4E"&gt;&lt;FONT color="#000000" face="Segoe UI" size="3"&gt;The MODEL statement is for the fixed effects and the RANDOM statement is for the random effects. PROC MIXED computes the estimates and standard errors for fixed effects using functions of the V matrix, which is the variance-covariance matrix of y. This matrix depends on the random effect specification and the repeated statement specification. So the standard errors for fixed effects have already taken into account the random effects in this model, and therefore accounted for the clusters in the data. &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="csBC719D4E"&gt;&lt;FONT color="#000000" face="Segoe UI" size="3"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class="cs224A0306"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class="csBC719D4E"&gt;&lt;FONT color="#000000" face="Segoe UI" size="3"&gt;If you have data from a complex survey design with cluster sampling then you could use the CLUSTER statement in PROC SURVEYREG. PROC SURVEYREG uses design-based methodology, instead of the model-based methods used in the traditional analysis procedures. Survey researchers are typically not interested in modeling the clusters and estimating parameters related to them. If you do have survey data but one of your goals is to estimate main effects or interactions involving clusters, you could omit the CLUSTER statement in this procedure. Keep in mind that the parameter estimates themselves are unaffected by the survey design, only their standard errors are, so this will not affect the estimates. If you do not have survey data then PROC MIXED is the better choice to use for fixed effects with clustered standard errors.&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="csBC719D4E"&gt;&lt;FONT color="#000000" face="Segoe UI" size="3"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="csBC719D4E"&gt;&lt;FONT color="#000000" face="Segoe UI" size="3"&gt;If you have panel data, you might find what you want in PROC PANEL. PROC PANEL is designed for panel data models, and it provides the HCCME= option to specify heteroscedasticity correction on the standard errors and the CLUSTER option to adjust standard errors for clustering. At this time, the CLUSTER option is only supported when certain HCCME correction is specified, that is, when HCCME =0, 1, 2, or 3. So if you want heteroscedasticity robust standard errors and also correction for clustering for the variance covariance matrix, then you can use the HCCME = 0, 1, 2, 3 option together with the CLUSTER option in MODEL statement using PROC PANEL. The &lt;/FONT&gt;&lt;A class="cs78027362" href="http://go.documentation.sas.com/?docsetId=etsug&amp;amp;docsetTarget=etsug_panel_syntax12.htm&amp;amp;docsetVersion=14.3&amp;amp;locale=en" target="new"&gt;&lt;SPAN class="cs126F6168"&gt;&lt;FONT color="#0000ff" face="Segoe UI" size="3"&gt;MODEL statement&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN class="csBC719D4E"&gt;&lt;FONT color="#000000" face="Segoe UI" size="3"&gt; syntax section of PROC PANEL documentation discusses this functionality. Scroll down to:&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="csBC719D4E"&gt;&lt;FONT color="#000000" face="Segoe UI" size="3"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs6FE56D2"&gt;&lt;FONT color="#000000"&gt;&lt;FONT size="3"&gt;&lt;FONT face="Segoe UI"&gt;&lt;SPAN class="csBC719D4E"&gt;HCCME= NO | &lt;/SPAN&gt;&lt;SPAN class="csDA6368FD"&gt;&lt;EM&gt;number &lt;/EM&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class="cs6FE56D2"&gt;&lt;SPAN class="csBC719D4E"&gt;&lt;FONT color="#000000" face="Segoe UI" size="3"&gt;&amp;nbsp; &amp;nbsp;specifies the type of HCCME variance-covariance matrix.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="csBC719D4E"&gt;&lt;FONT color="#000000" face="Segoe UI" size="3"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="csBC719D4E"&gt;&lt;FONT color="#000000" face="Segoe UI" size="3"&gt;If you specify HCCME=NO, the variance-covariance matrix is not corrected. The value number can be any integer from 0 to 4, inclusive.&amp;nbsp;By default, HCCME=NO. The formulas are defined in SAS/ETS(R) User's Guide &amp;gt;The PANEL Procedure &amp;gt; Details &amp;gt; Heteroscedasticity-Corrected Covariance Matrices.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs224A0306"&gt;&lt;FONT face="Segoe UI" size="3"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="csBC719D4E"&gt;&lt;FONT color="#000000" face="Segoe UI" size="3"&gt;The reference for the formula for the cluster adjustment is Wooldridge 2002, p152: &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="csBC719D4E"&gt;&lt;FONT color="#000000" face="Segoe UI" size="3"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="csBC719D4E"&gt;&lt;FONT color="#000000" face="Segoe UI" size="3"&gt;&amp;nbsp; &amp;nbsp;Wooldridge, J. M. (2002), Econometric Analysis of Cross Section and Panel Data, Cambridge, MA: MIT Press. &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="csBC719D4E"&gt;&lt;FONT color="#000000" face="Segoe UI" size="3"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="csBC719D4E"&gt;&lt;FONT color="#000000" face="Segoe UI" size="3"&gt;So a syntax example where FIRM and TIME are fixed effects, specifying the cluster adjustment to the variance-covariance matrix with HCCME is: &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="csBC719D4E"&gt;&lt;FONT color="#000000" face="Segoe UI" size="3"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="csBC719D4E"&gt;&lt;FONT color="#000000" face="Segoe UI" size="3"&gt;proc panel data=airline; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="csBC719D4E"&gt;&lt;FONT color="#000000" face="Segoe UI" size="3"&gt;&amp;nbsp; id firm time; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="csBC719D4E"&gt;&lt;FONT color="#000000" face="Segoe UI" size="3"&gt;&amp;nbsp; model y=x1 x2 x3 /fixtwo hccme = 2 cluster; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="csBC719D4E"&gt;&lt;FONT color="#000000" face="Segoe UI" size="3"&gt;run;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="csBC719D4E"&gt;&lt;FONT color="#000000" face="Segoe UI" size="3"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="csBC719D4E"&gt;&lt;FONT color="#000000" face="Segoe UI" size="3"&gt;The heteroscedasticity-consistent covariance matrix estimator (HCCME) was enhanced by adding the CLUSTER option for the plain sandwich form (HC0), the degrees-of-freedom-adjusted form (HC1), and two types of leverage-adjusted estimators (HC2 and HC3). The CLUSTER option enables you to calculate a cluster-corrected covariance matrix and provides cluster-adjusted standard errors for parameter estimates. PROC PANEL assumes the cross sections are correlated and that there is no autocorrelation in the time series.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="csBC719D4E"&gt;&lt;FONT color="#000000" face="Segoe UI" size="3"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="csBC719D4E"&gt;&lt;FONT color="#000000" face="Segoe UI" size="3"&gt;Other than the above mentioned cluster adjusted heteroscedasticity-corrected covariance matrix, we do not have other cluster adjusted standard errors on panel data models.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jan 2018 19:53:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Fixed-effects-with-cluster/m-p/430135#M22613</guid>
      <dc:creator>Zard</dc:creator>
      <dc:date>2018-01-23T19:53:35Z</dc:date>
    </item>
    <item>
      <title>Re: Fixed effects with cluster</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Fixed-effects-with-cluster/m-p/480320#M24980</link>
      <description>&lt;P&gt;Dear Zard,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your comprehensive explanation. But I think when we use "Proc Mixed", it cannot absorb fixed effects by firm and fix cluster standard errors by date. It absorbs fixed effects and fix cluster standard errors of the same variable. Do you know any other methods than "Proc Surveyreg" which enables to do that?&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jul 2018 02:12:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Fixed-effects-with-cluster/m-p/480320#M24980</guid>
      <dc:creator>khorram</dc:creator>
      <dc:date>2018-07-23T02:12:39Z</dc:date>
    </item>
    <item>
      <title>Re: Fixed effects with cluster</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Fixed-effects-with-cluster/m-p/551654#M27512</link>
      <description>&lt;P&gt;You can have a look at my macro which combines multi-way fixed effect, and multi-way clustering and IV estimates&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://olivier.godechot.free.fr/hoparticle.php?id_art=721" target="_blank"&gt;http://olivier.godechot.free.fr/hoparticle.php?id_art=721&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2019 11:40:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Fixed-effects-with-cluster/m-p/551654#M27512</guid>
      <dc:creator>Godechot</dc:creator>
      <dc:date>2019-04-17T11:40:00Z</dc:date>
    </item>
    <item>
      <title>Re: Fixed effects with cluster</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Fixed-effects-with-cluster/m-p/581033#M28496</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/8765"&gt;@Zard&lt;/a&gt;&amp;nbsp;Your reply is detailed and very helpful. I need your guidance regarding the case where Y is a dichotomous variable (1,0), and clustered standard errors are required at firm level with fixed effect at industry level. Your help will be much appreciated.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Aug 2019 09:46:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Fixed-effects-with-cluster/m-p/581033#M28496</guid>
      <dc:creator>Saba1</dc:creator>
      <dc:date>2019-08-14T09:46:44Z</dc:date>
    </item>
    <item>
      <title>Re: Fixed effects with cluster</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Fixed-effects-with-cluster/m-p/753666#M36675</link>
      <description>&lt;P&gt;Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/8765"&gt;@Zard&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a panel data set (firm-year), and I would like to include firm and year fixed effects and cluster standard errors at firm level.&lt;BR /&gt;I was trying PROC MIXED which you suggested, but in my case, I need to run a two stage regression, so I tried to output a data set where predicted estimates are included, so that I can regress on the predicted value in the second regression. However, I cannot find a statement that specifies outputting a data set with the predicted values in PROC MIXED.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As there aren't a large number of cluster levels in my data set, I've also tried PROC SURVEYREG. My code is as follows:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc surveyreg data=panel_data;
class firm year;
cluster firm;
model early_refin = turn_call  /*early_refin and turn_call are dummy variables*/
				asset
				leverage
				firm
				year
				/ adjrsq solution;
output out=firststage p=predicted_value;
run;

proc surveyreg data=firststage;
class firm year;
cluster firm;
model elimat = predicted_value /*elimat is a dummy variable*/
			asset
			leverage		
			firm
			year
			/ adjrsq solution;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The PROC SURVEYREG code above runs well, but the result was totally different from the one I got using R. I can see that the algorithm differs from software to software, but I was wondering if this PROC SURVEYREG code did the same thing as I expected it to do.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you give me some advice on how to perform my case (&lt;STRONG&gt;2SLS&lt;/STRONG&gt; &amp;amp; &lt;STRONG&gt;firm and year fixed effects&lt;/STRONG&gt; &amp;amp; &lt;STRONG&gt;cluster standard error at firm level&lt;/STRONG&gt;) or how to adjust the code above to match my request?&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jul 2021 06:33:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Fixed-effects-with-cluster/m-p/753666#M36675</guid>
      <dc:creator>YIN_YI_JEN</dc:creator>
      <dc:date>2021-07-13T06:33:41Z</dc:date>
    </item>
  </channel>
</rss>

