<?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: Clustered standard errors in proc panel in SAS Forecasting and Econometrics</title>
    <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Clustered-standard-errors-in-proc-panel/m-p/352929#M2296</link>
    <description>&lt;P&gt;Try the following code, which&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. &amp;nbsp;Runs the model as pooled regression with dummy variables for firm. &amp;nbsp;Because you specified the PRINTFIXED option I figured the number of firms as small to moderate, and thus the dummy variable approach would not be a problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. &amp;nbsp;Switches the order of the id variables so that quarter is now picked up as the main cluster.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3. &amp;nbsp;Makes a copy of the firm variable so that firm can be both an ID variable and a CLASS variable (That you need to do this is a quirk of current PROC PANEL, something we intend to change).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have; 
   set have;
   cfirm = firm;
run;

proc sort data = have; 
   by quarter firm;
run;

proc panel data=have plot=all;
   id quarter firm;
   class cfirm;
   model Y = x1 x2 cfirm / pooled noint HCCME=3 cluster;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Please email me at Bobby.Gutierrez@sas.com if you have any questions. &amp;nbsp;In the future, we hope to add general clustering ability to PROC PANEL, which would not require this workaround.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;--Bobby&lt;/P&gt;</description>
    <pubDate>Mon, 24 Apr 2017 15:53:37 GMT</pubDate>
    <dc:creator>bobby_sas</dc:creator>
    <dc:date>2017-04-24T15:53:37Z</dc:date>
    <item>
      <title>Clustered standard errors in proc panel</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Clustered-standard-errors-in-proc-panel/m-p/342121#M2295</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hello Everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In&amp;nbsp;one-way firm fixed effect panel regressioin, how can I get heteroskadasticity-robust standard errors&amp;nbsp;clustered by quarter? I would like the standard errors to be clustered by quarter, but based on the SAS support (&lt;A href="http://support.sas.com/documentation/cdl/en/etsug/63939/HTML/default/viewer.htm#etsug_panel_sect037.htm" target="_blank"&gt;link&lt;/A&gt;) it seems I can only get &lt;SPAN&gt;heteroskadasticity-robust standard errors clustered by firm, not by quarter. The code I have in mind is&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc panel data=have plot=all PRINTFIXED;
id firm quarter;
model Y = x1 x2  / fixone noint HCCME=3 cluster;
output out=est_panel residual=residual predicted=predicted;
run;&lt;/PRE&gt;
&lt;P&gt;and when I run this code, I believe the standard error I get is clustered by firm, and I canot find a way to cluster it by quarter.&amp;nbsp;&lt;SPAN&gt;In Stata, I can specify by which variable I would like the standard errors to be clustered but I can't find the similar option in SAS. Could anyone help?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;All the best,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Minsoo&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Mar 2017 19:14:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Clustered-standard-errors-in-proc-panel/m-p/342121#M2295</guid>
      <dc:creator>ibsulkim</dc:creator>
      <dc:date>2017-03-17T19:14:43Z</dc:date>
    </item>
    <item>
      <title>Re: Clustered standard errors in proc panel</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Clustered-standard-errors-in-proc-panel/m-p/352929#M2296</link>
      <description>&lt;P&gt;Try the following code, which&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. &amp;nbsp;Runs the model as pooled regression with dummy variables for firm. &amp;nbsp;Because you specified the PRINTFIXED option I figured the number of firms as small to moderate, and thus the dummy variable approach would not be a problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. &amp;nbsp;Switches the order of the id variables so that quarter is now picked up as the main cluster.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3. &amp;nbsp;Makes a copy of the firm variable so that firm can be both an ID variable and a CLASS variable (That you need to do this is a quirk of current PROC PANEL, something we intend to change).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have; 
   set have;
   cfirm = firm;
run;

proc sort data = have; 
   by quarter firm;
run;

proc panel data=have plot=all;
   id quarter firm;
   class cfirm;
   model Y = x1 x2 cfirm / pooled noint HCCME=3 cluster;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Please email me at Bobby.Gutierrez@sas.com if you have any questions. &amp;nbsp;In the future, we hope to add general clustering ability to PROC PANEL, which would not require this workaround.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;--Bobby&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2017 15:53:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Clustered-standard-errors-in-proc-panel/m-p/352929#M2296</guid>
      <dc:creator>bobby_sas</dc:creator>
      <dc:date>2017-04-24T15:53:37Z</dc:date>
    </item>
  </channel>
</rss>

