<?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: Setting Up a GLMM Model Using GLIMMIX in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Setting-Up-a-GLMM-Model-Using-GLIMMIX/m-p/315935#M16645</link>
    <description>&lt;P&gt;That skeleton code will get you started, once you add /dist=binary to the MODEL statement. &amp;nbsp;You may need to consider adding interaction terms to get at your questions of interest.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Make sure your input dataset is sorted by MotherID, and that MotherID is strictly numeric, as you are incorporating it as a subject effect, and it is not included in the CLASS statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As far as the other things:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Effect sizes in mixed models are not easily calculated. &amp;nbsp;Google is your friend here--there are some articles on lexjansen.com and elsewhere on the web that might help, but there is really no consensus on what the optimum method might be. &amp;nbsp;And whichever one you choose, almost certainly at least one reviewer will disagree&amp;nbsp;&lt;img id="manfrustrated" class="emoticon emoticon-manfrustrated" src="https://communities.sas.com/i/smilies/16x16_man-frustrated.png" alt="Man Frustrated" title="Man Frustrated" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As far as predicted values and confidence intervals: Do you want CLs for the model parameter estimates? if so add CL after dist=binary. &amp;nbsp;If you want predicted values at various levels of the continuous variables, for each level of the categoricals, look into the documentation for the LSMEANS statement. &amp;nbsp;In a sense, these are NOT predicted values, but rather marginal means. &amp;nbsp;Use of the STORE statement in MIXED and then the SCORE statement in PROC PLM would give you true predicted values for a dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But that can be searched here in this forum. &amp;nbsp;Check posts by&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13758"&gt;@lvm﻿&lt;/a&gt;&amp;nbsp;for advice on this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Steve Denham&lt;/P&gt;</description>
    <pubDate>Thu, 01 Dec 2016 13:46:36 GMT</pubDate>
    <dc:creator>SteveDenham</dc:creator>
    <dc:date>2016-12-01T13:46:36Z</dc:date>
    <item>
      <title>Setting Up a GLMM Model Using GLIMMIX</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Setting-Up-a-GLMM-Model-Using-GLIMMIX/m-p/314810#M16583</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to ask for your assistance with setting up a model using GLIMMIX.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My data involves births in a hospital. The variable of interest is whether the mother stayed in the hospital motel or not (1/0). My data contains around 40,000 observations, from which almost 30,000 did not stay in the motel and the rest did. Each line in the dataset represents a birth (with 1 baby or more). Some rows represents births of the same mother, therefore I have a variable called MotherID, and this is the reason why I need a random effect logistic regression here. The independent variable list if quite long, with approximately 25 possible variables for me to choose from - some continuous and some categorical. I am now filtering some out due to high correlations between them. Some variables are birth related and some are mother related, for example: Socioeconomical status of the mother (numeric), number of babies in the current birth (1 to 4), birth number in this hospital (first, second, ...), did the mother take a birth preparation course (yes/no), was the mother in emergency room prior the birth (yes/no), pregnancy week in birth time (numerical), number of days in emergency room (numerical), etc,....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For the sake of this discussion, let's call the categorical variables C1, C2, .... and the numeric ones X1, X2, ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wish to set up a model using GLIMMIX, a random effect logistic regression. I am not sure how to write it ( will give my attemp below ).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In addition, the sample size is fairly large. This means that small effects will give significanct P-Values. I need to ask SAS to give me some measure of effect size, so I can know if a significant P-Value is actually interesting or not. I also want to produce probabilities of going to the motel, based on the variables in the final model.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regarding a final model, should I enter variables manually, or is there an automatic way (stepwise, etc...)? I am not too keen to count on automatic ways...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My initial code is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc glimmix data = motel method = quad;

       class C1 C2 C3;

       model Motel = X1 X2 X3 C1 C2 C3;

       random int / subject = MotherID;

run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Is this code correct? How do I add effect sizes, predicted probabilities, confidence intervals, etc?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2016 13:47:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Setting-Up-a-GLMM-Model-Using-GLIMMIX/m-p/314810#M16583</guid>
      <dc:creator>BlueNose</dc:creator>
      <dc:date>2016-11-28T13:47:07Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Up a GLMM Model Using GLIMMIX</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Setting-Up-a-GLMM-Model-Using-GLIMMIX/m-p/315935#M16645</link>
      <description>&lt;P&gt;That skeleton code will get you started, once you add /dist=binary to the MODEL statement. &amp;nbsp;You may need to consider adding interaction terms to get at your questions of interest.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Make sure your input dataset is sorted by MotherID, and that MotherID is strictly numeric, as you are incorporating it as a subject effect, and it is not included in the CLASS statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As far as the other things:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Effect sizes in mixed models are not easily calculated. &amp;nbsp;Google is your friend here--there are some articles on lexjansen.com and elsewhere on the web that might help, but there is really no consensus on what the optimum method might be. &amp;nbsp;And whichever one you choose, almost certainly at least one reviewer will disagree&amp;nbsp;&lt;img id="manfrustrated" class="emoticon emoticon-manfrustrated" src="https://communities.sas.com/i/smilies/16x16_man-frustrated.png" alt="Man Frustrated" title="Man Frustrated" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As far as predicted values and confidence intervals: Do you want CLs for the model parameter estimates? if so add CL after dist=binary. &amp;nbsp;If you want predicted values at various levels of the continuous variables, for each level of the categoricals, look into the documentation for the LSMEANS statement. &amp;nbsp;In a sense, these are NOT predicted values, but rather marginal means. &amp;nbsp;Use of the STORE statement in MIXED and then the SCORE statement in PROC PLM would give you true predicted values for a dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But that can be searched here in this forum. &amp;nbsp;Check posts by&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13758"&gt;@lvm﻿&lt;/a&gt;&amp;nbsp;for advice on this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Steve Denham&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2016 13:46:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Setting-Up-a-GLMM-Model-Using-GLIMMIX/m-p/315935#M16645</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2016-12-01T13:46:36Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Up a GLMM Model Using GLIMMIX</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Setting-Up-a-GLMM-Model-Using-GLIMMIX/m-p/316374#M16666</link>
      <description>&lt;P&gt;Thank you Steve.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried running the code, and initially I got a log error about not having enough memory. My guess is, that I have too many subject ID's.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I looked on Google and found that I needed to add nloptions tech=nrridg; and ddfm=bw, I admit that I don't understand what it does, but it did run.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I used method = quad, for a one variable model, I got an OR of 11. When I used method = laplace I got an OR of 4. Without specifying a method, I got OR of 3.2. If I run a logistic regression without considering the random effect, or if I use a two by two table, I get an OR of 3.2. Since a vast majority of my subjects do have only 1 observation, I find it hard to believe that 11 is the correct OR. Do you have an explanation what cause quad and laplace to get the OR wrong? I have to say, when seeing this result, I tried running the model with another software, and surprise surprise, I got OR = 11 again, which is incorrect if you ask me.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2016 20:27:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Setting-Up-a-GLMM-Model-Using-GLIMMIX/m-p/316374#M16666</guid>
      <dc:creator>BlueNose</dc:creator>
      <dc:date>2016-12-02T20:27:30Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Up a GLMM Model Using GLIMMIX</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Setting-Up-a-GLMM-Model-Using-GLIMMIX/m-p/317902#M16745</link>
      <description>&lt;P&gt;Those values for the OR are what you would expect given:&lt;/P&gt;
&lt;P&gt;No method gives REML values which are biased toward 1, as these are marginal values.&lt;/P&gt;
&lt;P&gt;Method=laplace uses a single point of support when calculating the integrals for the maximum likelihood, so in a sense, it is intermediate between the marginal REML values and the best approximated conditional values obtained from method=quad.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Of your values, I would trust the OR=11 as the best description of your data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would say that there is something unusual about the subjects that result in multiple observations as compared to the single observations. &amp;nbsp;I might even go so far as trying to model a factor that separates subjects into these two groups, and seeing what the behavior of the model and the resulting OR values might be.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Steve Denham&lt;/P&gt;</description>
      <pubDate>Fri, 09 Dec 2016 14:14:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Setting-Up-a-GLMM-Model-Using-GLIMMIX/m-p/317902#M16745</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2016-12-09T14:14:41Z</dc:date>
    </item>
  </channel>
</rss>

