<?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 The ultimate fixed effect with clustering: proc surveyreg in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/The-ultimate-fixed-effect-with-clustering-proc-surveyreg/m-p/624391#M30050</link>
    <description>&lt;P&gt;I have firm-year observations with industry data. Using this data, I have created industry*year interaction called 'group1'. I would like to&lt;/P&gt;&lt;P&gt;1) cluster standard error by firm-year&lt;/P&gt;&lt;P&gt;2) include firm and group1 fixed effect&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I could have used (which worked if the fixed effects were only industry and year) is as below:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc surveyreg data=work;
    cluster fyear gvkey;
    class gvkey group1;
    model dv=iv1 iv2 iv3 gvkey group1 / adjrsq solution;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This no longer works because I have too many variables for fixed effects (both firm and group1). I also cannot do 2-way clustering (fyear and gvkey) in this procedure.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been downloading the dataset and run the tests with STATA, but I believe there must be a way to yield the same results using SAS. Would anyone be able to help me with any suggestions? Thank you in advance.&lt;/P&gt;</description>
    <pubDate>Thu, 13 Feb 2020 01:53:27 GMT</pubDate>
    <dc:creator>kelSAS</dc:creator>
    <dc:date>2020-02-13T01:53:27Z</dc:date>
    <item>
      <title>The ultimate fixed effect with clustering: proc surveyreg</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/The-ultimate-fixed-effect-with-clustering-proc-surveyreg/m-p/624391#M30050</link>
      <description>&lt;P&gt;I have firm-year observations with industry data. Using this data, I have created industry*year interaction called 'group1'. I would like to&lt;/P&gt;&lt;P&gt;1) cluster standard error by firm-year&lt;/P&gt;&lt;P&gt;2) include firm and group1 fixed effect&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I could have used (which worked if the fixed effects were only industry and year) is as below:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc surveyreg data=work;
    cluster fyear gvkey;
    class gvkey group1;
    model dv=iv1 iv2 iv3 gvkey group1 / adjrsq solution;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This no longer works because I have too many variables for fixed effects (both firm and group1). I also cannot do 2-way clustering (fyear and gvkey) in this procedure.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been downloading the dataset and run the tests with STATA, but I believe there must be a way to yield the same results using SAS. Would anyone be able to help me with any suggestions? Thank you in advance.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Feb 2020 01:53:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/The-ultimate-fixed-effect-with-clustering-proc-surveyreg/m-p/624391#M30050</guid>
      <dc:creator>kelSAS</dc:creator>
      <dc:date>2020-02-13T01:53:27Z</dc:date>
    </item>
    <item>
      <title>Re: The ultimate fixed effect with clustering: proc surveyreg</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/The-ultimate-fixed-effect-with-clustering-proc-surveyreg/m-p/624469#M30051</link>
      <description>&lt;P&gt;Multilevel (hierarchical) linear models are generally fit by using PROC MIXED (or GLIMMIX for certain response variables). In PROC MIXED you can use the RANDOM statement (and SUBJECT= option) to specify the nested relationships, such as students within classroom within school within districts.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are many papers that you can find if you search for&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;sas proceedings hierarchical models "proc mixed"&lt;/P&gt;
&lt;P&gt;such as&lt;/P&gt;
&lt;P&gt;&lt;A href="https://lexjansen.com/mwsug/1999/paper23.pdf" target="_self"&gt;Using PROC MIXED in Hierarchical Linear Models&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/resources/papers/proceedings13/433-2013.pdf" target="_self"&gt;A Multilevel Model Primer Using SAS PROC MIXED&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are also papers that show how to use PROC GLMMIX for generalized linear models and PROC NLMIXED for nonlinear models. Replace "proc mixed"&amp;nbsp; int he search with the relevant terms if you are interested in those topics.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since you mention STATA, I will mention that there is an excellent&amp;nbsp;&lt;SPAN&gt;book that compares mixed models in different software packages:&amp;nbsp;West, B. T., Welch, K. B., &amp;amp; Galecki, A. T. (2015). Linear mixed models: A practical guide using statistical software (2nd ed.). Boca Raton, FL: CRC Press.&amp;nbsp; It compares&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;SAS, SPSS, Stata, R/S-plus, and HLM.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Feb 2020 13:40:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/The-ultimate-fixed-effect-with-clustering-proc-surveyreg/m-p/624469#M30051</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2020-02-13T13:40:57Z</dc:date>
    </item>
  </channel>
</rss>

