<?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: questions about proc glimmix code in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/questions-about-proc-glimmix-code/m-p/884733#M43828</link>
    <description>&lt;OL&gt;
&lt;LI&gt;&lt;STRONG&gt;method=laplace &lt;/STRONG&gt;&lt;SPAN&gt;is a maximum likelihood based estimation method, which honors the specified distribution.&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;method=rspl&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;ns a pesudo-likelihood estimation method.&amp;nbsp; Both have pros and cons. See the documentation for details.&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/v_040/statug/statug_glimmix_details06.htm" target="_blank"&gt;https://go.documentation.sas.com/doc/en/pgmsascdc/v_040/statug/statug_glimmix_details06.htm&lt;/A&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;Yes. Using either &lt;/SPAN&gt;&lt;STRONG&gt;dist=binary&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;or &lt;/SPAN&gt;&lt;STRONG&gt;dist=binomial&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;is fine. If you have event/trials syntax as the dependent variable, you would use dist=binomial (default).&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;LSMEANS for A is computed averaged across other covariates in the model. You can add the E option in the LSMEANS statement to see exactly how it is computed.&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;By default LSMEANS are computed over a balanced population, that is, each level receives the same fraction regardless of the sample size in your data. The BYLEVEL option would base the "fraction" on the group sample size in your data. Again, the E option would tell you exactly how that affects the LSMEANS computations. BYLEVEL is explained in the documentation below -&lt;/SPAN&gt;&lt;SPAN&gt;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/v_040/statug/statug_glimmix_syntax13.htm#statug.glimmix.gmxlsmbylevel" target="_blank"&gt;https://go.documentation.sas.com/doc/en/pgmsascdc/v_040/statug/statug_glimmix_syntax13.htm#statug.glimmix.gmxlsmbylevel&lt;/A&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&lt;SPAN&gt;Hope this helps,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Jill&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 13 Jul 2023 23:09:18 GMT</pubDate>
    <dc:creator>jiltao</dc:creator>
    <dc:date>2023-07-13T23:09:18Z</dc:date>
    <item>
      <title>questions about proc glimmix code</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/questions-about-proc-glimmix-code/m-p/884571#M43824</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hello!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;We have data on students who are nested within colleges, and we’re using GLIMMIX to run a multi-level regression model to predict whether or not a student declares a certain major in their first year of college (outcome) based on whether or not they take that subject in high school (main predictor). This is what our GLIMMIX code looks like:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;proc glimmix data=&amp;amp;dsn &lt;/SPAN&gt;&lt;STRONG&gt;method=laplace&lt;/STRONG&gt;&lt;SPAN&gt; noclprint;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;class &amp;amp;class_var;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;model outcome_var (event=’1’) = &amp;amp;ivlist /&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;cl &lt;/SPAN&gt;&lt;STRONG&gt;dist=binary&lt;/STRONG&gt;&lt;SPAN&gt; link=logit solution oddsratio;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;random intercept / subject=&amp;amp;subject_var type=vc solution cl;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;covtest / wald ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;lsmeans&lt;/STRONG&gt;&lt;SPAN&gt; &amp;amp;lsmeans_var /&lt;/SPAN&gt;&lt;STRONG&gt; bylevel&lt;/STRONG&gt;&lt;SPAN&gt; cl ilink ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;run ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;where:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;class_var includes a list of categorical covariates with reference groups specified&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;ivlist includes the main predictor and all other covariates&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;subject_var is the college code (second level/grouping variable)&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;lsmeans_var includes a list of categorical variables like our main predictor, student’s gender, etc.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;We borrowed a majority of the syntax from page 4 of this PDF: &lt;/SPAN&gt;&lt;A href="https://support.sas.com/resources/papers/proceedings15/3430-2015.pdf" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;https://support.sas.com/resources/papers/proceedings15/3430-2015.pdf&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;. We have a couple of questions about understanding some of these options and whether they are appropriate for our situation:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;SPAN&gt;Is there a reason we should use &lt;/SPAN&gt;&lt;STRONG&gt;method=laplace&lt;/STRONG&gt;&lt;SPAN&gt; rather than the default &lt;/SPAN&gt;&lt;STRONG&gt;method=rspl&lt;/STRONG&gt;&lt;SPAN&gt; in our case?&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Should we use &lt;/SPAN&gt;&lt;STRONG&gt;dist=binary&lt;/STRONG&gt;&lt;SPAN&gt; because our outcome variable only has 2 outcomes (majored / didn’t major)? In what case would we use &lt;/SPAN&gt;&lt;STRONG&gt;dist=binomial&lt;/STRONG&gt;&lt;SPAN&gt; instead?&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;We used the &lt;/SPAN&gt;&lt;STRONG&gt;lsmeans &lt;/STRONG&gt;&lt;SPAN&gt;statement because we want to get the average predicted probabilities of our outcome for each level of categorical variables in the list lsmeans_var. Does &lt;/SPAN&gt;&lt;STRONG&gt;lsmeans&lt;/STRONG&gt;&lt;SPAN&gt; assume reference values or grand mean values for all the other categorical covariates in the model when calculating marginal means?&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;A small percentage of students declare the major, so does that make our sample unbalanced? Does&lt;/SPAN&gt;&lt;STRONG&gt; bylevel&lt;/STRONG&gt;&lt;SPAN&gt; help with this by calculating &lt;/SPAN&gt;&lt;STRONG&gt;lsmeans &lt;/STRONG&gt;&lt;SPAN&gt;for each group separately as opposed to using the entire sample size as the denominator when calculating predicted probabilities of lsmeans_var?&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any help would be greatly appreciated!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jul 2023 20:07:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/questions-about-proc-glimmix-code/m-p/884571#M43824</guid>
      <dc:creator>astronomy_tower</dc:creator>
      <dc:date>2023-07-12T20:07:47Z</dc:date>
    </item>
    <item>
      <title>Re: questions about proc glimmix code</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/questions-about-proc-glimmix-code/m-p/884721#M43825</link>
      <description>&lt;P&gt;I have moved your post to :&lt;/P&gt;
&lt;P&gt;Home &amp;gt;&amp;gt; Analytics &amp;gt;&amp;gt; Statistical Procedures&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2023 20:55:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/questions-about-proc-glimmix-code/m-p/884721#M43825</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2023-07-13T20:55:10Z</dc:date>
    </item>
    <item>
      <title>Re: questions about proc glimmix code</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/questions-about-proc-glimmix-code/m-p/884733#M43828</link>
      <description>&lt;OL&gt;
&lt;LI&gt;&lt;STRONG&gt;method=laplace &lt;/STRONG&gt;&lt;SPAN&gt;is a maximum likelihood based estimation method, which honors the specified distribution.&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;method=rspl&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;ns a pesudo-likelihood estimation method.&amp;nbsp; Both have pros and cons. See the documentation for details.&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/v_040/statug/statug_glimmix_details06.htm" target="_blank"&gt;https://go.documentation.sas.com/doc/en/pgmsascdc/v_040/statug/statug_glimmix_details06.htm&lt;/A&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;Yes. Using either &lt;/SPAN&gt;&lt;STRONG&gt;dist=binary&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;or &lt;/SPAN&gt;&lt;STRONG&gt;dist=binomial&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;is fine. If you have event/trials syntax as the dependent variable, you would use dist=binomial (default).&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;LSMEANS for A is computed averaged across other covariates in the model. You can add the E option in the LSMEANS statement to see exactly how it is computed.&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;By default LSMEANS are computed over a balanced population, that is, each level receives the same fraction regardless of the sample size in your data. The BYLEVEL option would base the "fraction" on the group sample size in your data. Again, the E option would tell you exactly how that affects the LSMEANS computations. BYLEVEL is explained in the documentation below -&lt;/SPAN&gt;&lt;SPAN&gt;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/v_040/statug/statug_glimmix_syntax13.htm#statug.glimmix.gmxlsmbylevel" target="_blank"&gt;https://go.documentation.sas.com/doc/en/pgmsascdc/v_040/statug/statug_glimmix_syntax13.htm#statug.glimmix.gmxlsmbylevel&lt;/A&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&lt;SPAN&gt;Hope this helps,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Jill&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2023 23:09:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/questions-about-proc-glimmix-code/m-p/884733#M43828</guid>
      <dc:creator>jiltao</dc:creator>
      <dc:date>2023-07-13T23:09:18Z</dc:date>
    </item>
  </channel>
</rss>

