<?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: Proc Glimmix Poisson regression model with random intercept in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-Glimmix-Poisson-regression-model-with-random-intercept/m-p/879593#M43516</link>
    <description>&lt;P&gt;If CLASSROOM is a random effect, then you do not list that effect on the MODEL statement. Only fixed effects appear on the MODEL statement. If you have multiple observations for each student in a classroom, then you could try ID(CLASSROOM) as an additional random effect. If you only have one observation per student, then you do not have enough data to include ID(CLASSROOM) in the model.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes, you can include both student-level and classroom-level covariates in the model. GLIMMIX will assign the correct df to those effects based on how they change or do not change within levels of the random effect.&lt;/P&gt;</description>
    <pubDate>Wed, 07 Jun 2023 15:17:17 GMT</pubDate>
    <dc:creator>StatsMan</dc:creator>
    <dc:date>2023-06-07T15:17:17Z</dc:date>
    <item>
      <title>Proc Glimmix Poisson regression model with random intercept</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-Glimmix-Poisson-regression-model-with-random-intercept/m-p/879443#M43505</link>
      <description>&lt;P&gt;Hello SAS community,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am currently trying to fit a Poisson regression model with random intercept and fixed slope. I am not sure if it makes sense to include a random intercept. The sample size is about 300, and the data contains variables:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ID: identification&lt;/P&gt;
&lt;P&gt;classroom: classroom # (integer from 1 to 9)&lt;/P&gt;
&lt;P&gt;fail: binary response variable whether the student failed an exam (1=fail, 0=no fail)&lt;/P&gt;
&lt;P&gt;size: size of the classroom in sq. ft. (continuous)&lt;/P&gt;
&lt;P&gt;gender: gender of the student (0,1)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to compute:&lt;/P&gt;
&lt;P&gt;(1) the exam fail rate ratio depending on size of the classroom, adjusted for classroom #&lt;/P&gt;
&lt;P&gt;(1) the exam fail rate ratio for male vs. female students, adjusted for classroom #&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So the current SAS code I have is:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc glimmix;
class id classroom gender;
model fail = classroom size / solution ;
random intercept /subject = classroom g type=un;
run;

proc glimmix;
class id classroom gender;
model fail = classroom gender / solution ;
random intercept /subject = classroom g type=un;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I have few questions:&lt;/P&gt;
&lt;P&gt;-I would like to consider classroom # as a random intercept. Should I include ID as well? (i.e.) subject = classroom(ID)&lt;/P&gt;
&lt;P&gt;-The same classroom would have the same size. So for example all students in classroom 1 would have same size variable. Does it make sense to include both classroom and size variables (one fixed, one random) in the model?&lt;/P&gt;
&lt;P&gt;-Please advise on what other possible approach there is.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you,&lt;/P&gt;
&lt;P&gt;RC&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2023 20:33:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-Glimmix-Poisson-regression-model-with-random-intercept/m-p/879443#M43505</guid>
      <dc:creator>hellorc</dc:creator>
      <dc:date>2023-06-06T20:33:06Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Glimmix Poisson regression model with random intercept</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-Glimmix-Poisson-regression-model-with-random-intercept/m-p/879593#M43516</link>
      <description>&lt;P&gt;If CLASSROOM is a random effect, then you do not list that effect on the MODEL statement. Only fixed effects appear on the MODEL statement. If you have multiple observations for each student in a classroom, then you could try ID(CLASSROOM) as an additional random effect. If you only have one observation per student, then you do not have enough data to include ID(CLASSROOM) in the model.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes, you can include both student-level and classroom-level covariates in the model. GLIMMIX will assign the correct df to those effects based on how they change or do not change within levels of the random effect.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2023 15:17:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-Glimmix-Poisson-regression-model-with-random-intercept/m-p/879593#M43516</guid>
      <dc:creator>StatsMan</dc:creator>
      <dc:date>2023-06-07T15:17:17Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Glimmix Poisson regression model with random intercept</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-Glimmix-Poisson-regression-model-with-random-intercept/m-p/881569#M43616</link>
      <description>&lt;P&gt;One thing to remember about GLIMMIX is that it only has a RANDOM statement, and no REPEATED statement as in many other of the linear modeling procs. So it is entirely possible that an effect be included in the MODEL statement and a RANDOM statement, so long as the &lt;STRONG&gt;residual&amp;nbsp;&lt;/STRONG&gt;option is applied. That requires by subject processing.&amp;nbsp; And, if you wish to model a G-side repeated measures design (which occurs quite a bit with count data), you can dispense with the &lt;STRONG&gt;residual&lt;/STRONG&gt; option.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is just one more of those things that you need to be very cognizant of when writing GLIMMIX code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jun 2023 18:43:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-Glimmix-Poisson-regression-model-with-random-intercept/m-p/881569#M43616</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2023-06-20T18:43:59Z</dc:date>
    </item>
  </channel>
</rss>

