<?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: Cluster errors in Proc GLM in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Cluster-errors-in-Proc-GLM/m-p/862331#M42635</link>
    <description>&lt;P&gt;If the data consist of clusters of correlated observations as defined by your MSA variable, then you probably just want a Generalized Estimating Equations (GEE) model which you can fit with PROC GEE. It properly accounts for the correlation within the clusters and provides tests of the effects of the predictors at the population level. For example,&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc gee data=data;
class Year Health_Plan Gender MSA;
model ln_cost= Year Health_Plan Age Gender riskscore;
repeated subject=MSA;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;PROC MIXED with a REPEATED statement could be used if you want a subject-specific model that can provide predictions at the observation level.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, if you data were collected as part of a survey design, then you should use PROC SURVEYREG to get proper standard errors. Neither GEE nor MIXED is designed to analyze survey data.&lt;/P&gt;</description>
    <pubDate>Sun, 05 Mar 2023 03:44:46 GMT</pubDate>
    <dc:creator>StatDave</dc:creator>
    <dc:date>2023-03-05T03:44:46Z</dc:date>
    <item>
      <title>Cluster errors in Proc GLM</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Cluster-errors-in-Proc-GLM/m-p/861830#M42633</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am running a regression model with GLM and want to cluster errors at the MSA (Metropolitan Statistical Area) level. Are there any options in GLM that does this?&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;My code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc glm data=data;
class Year Health_Plan Gender MSA;
   model ln_cost= Year Health_Plan Age Gender riskscore MSA / solution;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2023 19:29:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Cluster-errors-in-Proc-GLM/m-p/861830#M42633</guid>
      <dc:creator>Bright</dc:creator>
      <dc:date>2023-03-01T19:29:29Z</dc:date>
    </item>
    <item>
      <title>Re: Cluster errors in Proc GLM</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Cluster-errors-in-Proc-GLM/m-p/862327#M42634</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you want to obtain clustered standard errors at the MSA level?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not possible with PROC GLM , but maybe you can consider "absorption".&lt;/P&gt;
&lt;P&gt;&lt;A href="https://go.documentation.sas.com/doc/en/statug/15.3/statug_glm_syntax02.htm" target="_blank"&gt;https://go.documentation.sas.com/doc/en/statug/15.3/statug_glm_syntax02.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Otherwise, turn to PROC MIXED.&lt;/P&gt;
&lt;P&gt;(&amp;nbsp;&lt;SPAN&gt;PROC MIXED uses the GLS to estimate the fixed effects. PROC GLM is using the OLS method to fit a fixed effect model )&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;PROC MIXED adjusts the standard errors for the fixed effects when you have a RANDOM statement in the model. The standard error for the fixed effect is calculated here using both the residual variance and the variance of the random effect, so the standard error is adjusted for the clustering.&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc mixed empirical;
  class MSA;
  model y = x1 x2 x3 / s;
  random int / subject=MSA;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or use PROC PANEL with the CLUSTER option if you have time-series cross-sectional data. &lt;BR /&gt;( I see you have YEAR as an input )&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or use PROC SURVEYREG with the CLUSTER statement if you have survey data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Sun, 05 Mar 2023 00:54:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Cluster-errors-in-Proc-GLM/m-p/862327#M42634</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2023-03-05T00:54:50Z</dc:date>
    </item>
    <item>
      <title>Re: Cluster errors in Proc GLM</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Cluster-errors-in-Proc-GLM/m-p/862331#M42635</link>
      <description>&lt;P&gt;If the data consist of clusters of correlated observations as defined by your MSA variable, then you probably just want a Generalized Estimating Equations (GEE) model which you can fit with PROC GEE. It properly accounts for the correlation within the clusters and provides tests of the effects of the predictors at the population level. For example,&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc gee data=data;
class Year Health_Plan Gender MSA;
model ln_cost= Year Health_Plan Age Gender riskscore;
repeated subject=MSA;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;PROC MIXED with a REPEATED statement could be used if you want a subject-specific model that can provide predictions at the observation level.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, if you data were collected as part of a survey design, then you should use PROC SURVEYREG to get proper standard errors. Neither GEE nor MIXED is designed to analyze survey data.&lt;/P&gt;</description>
      <pubDate>Sun, 05 Mar 2023 03:44:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Cluster-errors-in-Proc-GLM/m-p/862331#M42635</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2023-03-05T03:44:46Z</dc:date>
    </item>
    <item>
      <title>Re: Cluster errors in Proc GLM</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Cluster-errors-in-Proc-GLM/m-p/862592#M42649</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Thanks for the reply. I do not have panel or survey data. It seems proc glm with absorb, proc mixed, and proc genmod work. However, the reported standard errors and hence the significant levels are very different between glm and the other two&lt;SPAN class="issue-underline underline text-gray-darkest font-body decoration-2 underline-offset-4 transition decoration-error-light hover:bg-error-lightest" data-issueid="ae0816e5-a2a2-42a8-83eb-ceffa17104db" data-testid="issue-underline:processes."&gt;.&lt;/SPAN&gt; How are these processes' standard errors calculated?&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 06 Mar 2023 23:17:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Cluster-errors-in-Proc-GLM/m-p/862592#M42649</guid>
      <dc:creator>Bright</dc:creator>
      <dc:date>2023-03-06T23:17:36Z</dc:date>
    </item>
    <item>
      <title>Re: Cluster errors in Proc GLM</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Cluster-errors-in-Proc-GLM/m-p/862595#M42650</link>
      <description>You can still use GEE even if you do not have clusters of observations and it will still provide robust standard errors. You have to specify the REPEATED statement, but you can create a variable that uniquely identifies each observation and then specify that variable in the SUBJECT=option.</description>
      <pubDate>Mon, 06 Mar 2023 23:24:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Cluster-errors-in-Proc-GLM/m-p/862595#M42650</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2023-03-06T23:24:18Z</dc:date>
    </item>
  </channel>
</rss>

