<?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 How do I model multinomial outcome in proc glimmix in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-model-multinomial-outcome-in-proc-glimmix/m-p/779950#M38298</link>
    <description>&lt;P&gt;Hello there, i want to model probabilitys for piglets being outside.&lt;/P&gt;&lt;P&gt;I am using SAS 9.4.&lt;/P&gt;&lt;P&gt;My dependent variable "haeufigkeitskategorie" has three values 0= no piglets outside 1= 1-50% of the piglets outside and 2= more than 50% outside. The variable "jahreszeit" means season an has four classes. So i run the code below, but i am not sure if my estimate statements are correct.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc glimmix data=final_f;
class jahreszeit bucht;
   model haeufigkeitskategorie = jahreszeit
/ dist=multi link = clogit oddsratio(diff=all) solution;
random intercept/ subject = bucht;
estimate "kat 0: frühling" intercept 1 0 0 jahreszeit 1 0 0 0/ ilink;
estimate "kat 0,1: frühling" intercept 0 1 0 jahreszeit 1 0 0 0/ ilink;
estimate "kat 0: herbst" intercept 1 0 0 jahreszeit  0 1 0 0/ ilink;
estimate "kat 0,1: herbst" intercept 0 1 0 jahreszeit 0 1 0 0/ ilink;
estimate "kat 0: sommer" intercept 1 0 0 jahreszeit 0 0 1 0/ ilink;
estimate "kat 0,1: sommer" intercept 0 1 0 jahreszeit 0 0 1 0 / ilink;
estimate "kat 0: winter" intercept 1 0 0 jahreszeit  0 0 0 1/ ilink;
estimate "kat 0,1: winter" intercept 0 1 0 jahreszeit 0  0 0 1/ ilink;
title 'glimmix haeufigkeitskategorie ferkel';
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The output seems logical:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="glimmix.PNG" style="width: 585px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/65635i4AE89A3F6BAA2EE2/image-size/large?v=v2&amp;amp;px=999" role="button" title="glimmix.PNG" alt="glimmix.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;My problem is that actually my model contains more class variables like daytime (day or night), age of the piglets (1-10days) and continious variables like rainfall (liter/m²) and temperature.&lt;/P&gt;&lt;P&gt;So if i try the code below (no more season but temperature, it is highly correlated) i don't get estimates for kat 0,1. And i really don't kow how to get estimates for temperature and rainfall.&lt;/P&gt;&lt;P&gt;Is there anyone who could help, please?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards and thank you,&lt;/P&gt;&lt;P&gt;Julika&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc glimmix data=final_f;
class tageszeit alter_tag bucht;
   model haeufigkeitskategorie = tageszeit alter_tag lufttemp niederschlag_stuendlich
/ dist=multi link = clogit oddsratio solution;
random intercept/ subject = bucht;
estimate "kat 0: nacht" intercept 1 0 tageszeit 1 0 / ilink;
estimate "kat 0,1: nacht" intercept 0 1  tageszeit 1 0/ ilink;
estimate "kat 0: tag" intercept 1 0 0  tageszeit  0 1 / ilink;
estimate "kat 0,1: tag" intercept 0 1 0 tageszeit 0 1 / ilink;
estimate "kat 0: alter_1" intercept 1 0 0 alter_tag 1 0 0 0 0 0 0 0 0 0;
estimate "kat 0,1 alter_1" intercept 0 1 0 alter_tag 1 0 0 0 0 0 0 0 0 0;
estimate "kat 0: alter_5" intercept 1 0 0 alter_tag 0 0 0 0 1 0 0 0 0 0;
estimate "kat 0,1 alter_5" intercept 0 1 0 alter_tag 0 0 0 0 1 0 0 0 0 0;
estimate "kat 0: alter_10" intercept 1 0 0 alter_tag 0 0 0 0 0 0 0 0 0 1;
estimate "kat 0,1 alter_10" intercept 0 1 0 alter_tag 0 0 0 0 0 0 0 0 0 1;
title 'glimmix haeufigkeitskategorie ferkel mit lufttemp';
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 12 Nov 2021 10:40:32 GMT</pubDate>
    <dc:creator>JulikaW</dc:creator>
    <dc:date>2021-11-12T10:40:32Z</dc:date>
    <item>
      <title>How do I model multinomial outcome in proc glimmix</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-model-multinomial-outcome-in-proc-glimmix/m-p/779950#M38298</link>
      <description>&lt;P&gt;Hello there, i want to model probabilitys for piglets being outside.&lt;/P&gt;&lt;P&gt;I am using SAS 9.4.&lt;/P&gt;&lt;P&gt;My dependent variable "haeufigkeitskategorie" has three values 0= no piglets outside 1= 1-50% of the piglets outside and 2= more than 50% outside. The variable "jahreszeit" means season an has four classes. So i run the code below, but i am not sure if my estimate statements are correct.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc glimmix data=final_f;
class jahreszeit bucht;
   model haeufigkeitskategorie = jahreszeit
/ dist=multi link = clogit oddsratio(diff=all) solution;
random intercept/ subject = bucht;
estimate "kat 0: frühling" intercept 1 0 0 jahreszeit 1 0 0 0/ ilink;
estimate "kat 0,1: frühling" intercept 0 1 0 jahreszeit 1 0 0 0/ ilink;
estimate "kat 0: herbst" intercept 1 0 0 jahreszeit  0 1 0 0/ ilink;
estimate "kat 0,1: herbst" intercept 0 1 0 jahreszeit 0 1 0 0/ ilink;
estimate "kat 0: sommer" intercept 1 0 0 jahreszeit 0 0 1 0/ ilink;
estimate "kat 0,1: sommer" intercept 0 1 0 jahreszeit 0 0 1 0 / ilink;
estimate "kat 0: winter" intercept 1 0 0 jahreszeit  0 0 0 1/ ilink;
estimate "kat 0,1: winter" intercept 0 1 0 jahreszeit 0  0 0 1/ ilink;
title 'glimmix haeufigkeitskategorie ferkel';
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The output seems logical:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="glimmix.PNG" style="width: 585px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/65635i4AE89A3F6BAA2EE2/image-size/large?v=v2&amp;amp;px=999" role="button" title="glimmix.PNG" alt="glimmix.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;My problem is that actually my model contains more class variables like daytime (day or night), age of the piglets (1-10days) and continious variables like rainfall (liter/m²) and temperature.&lt;/P&gt;&lt;P&gt;So if i try the code below (no more season but temperature, it is highly correlated) i don't get estimates for kat 0,1. And i really don't kow how to get estimates for temperature and rainfall.&lt;/P&gt;&lt;P&gt;Is there anyone who could help, please?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards and thank you,&lt;/P&gt;&lt;P&gt;Julika&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc glimmix data=final_f;
class tageszeit alter_tag bucht;
   model haeufigkeitskategorie = tageszeit alter_tag lufttemp niederschlag_stuendlich
/ dist=multi link = clogit oddsratio solution;
random intercept/ subject = bucht;
estimate "kat 0: nacht" intercept 1 0 tageszeit 1 0 / ilink;
estimate "kat 0,1: nacht" intercept 0 1  tageszeit 1 0/ ilink;
estimate "kat 0: tag" intercept 1 0 0  tageszeit  0 1 / ilink;
estimate "kat 0,1: tag" intercept 0 1 0 tageszeit 0 1 / ilink;
estimate "kat 0: alter_1" intercept 1 0 0 alter_tag 1 0 0 0 0 0 0 0 0 0;
estimate "kat 0,1 alter_1" intercept 0 1 0 alter_tag 1 0 0 0 0 0 0 0 0 0;
estimate "kat 0: alter_5" intercept 1 0 0 alter_tag 0 0 0 0 1 0 0 0 0 0;
estimate "kat 0,1 alter_5" intercept 0 1 0 alter_tag 0 0 0 0 1 0 0 0 0 0;
estimate "kat 0: alter_10" intercept 1 0 0 alter_tag 0 0 0 0 0 0 0 0 0 1;
estimate "kat 0,1 alter_10" intercept 0 1 0 alter_tag 0 0 0 0 0 0 0 0 0 1;
title 'glimmix haeufigkeitskategorie ferkel mit lufttemp';
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Nov 2021 10:40:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-model-multinomial-outcome-in-proc-glimmix/m-p/779950#M38298</guid>
      <dc:creator>JulikaW</dc:creator>
      <dc:date>2021-11-12T10:40:32Z</dc:date>
    </item>
    <item>
      <title>Re: How do I model multinomial outcome in proc glimmix</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-model-multinomial-outcome-in-proc-glimmix/m-p/780463#M38310</link>
      <description>&lt;P&gt;If "bucht" indicates a group of animals and, for each group, if you know the total number of animals as well as the number of those animals outside, then this can be modeled using a logistic model without the need for a RANDOM statement. For example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc logistic data=final_f;
class tageszeit alter_tag / param=glm;
model NumOut/NumInBucht = tageszeit alter_tag lufttemp niederschlag_stuendlich;
lsmeans tageszeit alter_tag / ilink;
run;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 16 Nov 2021 15:01:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-model-multinomial-outcome-in-proc-glimmix/m-p/780463#M38310</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2021-11-16T15:01:33Z</dc:date>
    </item>
    <item>
      <title>Re: How do I model multinomial outcome in proc glimmix</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-model-multinomial-outcome-in-proc-glimmix/m-p/781553#M38386</link>
      <description>&lt;P&gt;Hello Dave,&lt;/P&gt;&lt;P&gt;thank you for your reply!&lt;/P&gt;&lt;P&gt;I'm sorry, i wasn't clear enough. "bucht" means not group but stable, so it is really a random variable.&lt;/P&gt;&lt;P&gt;I know the exact number of animals in each group, but i wasn't able to count the ones outside every time, so often i just know if few (categorie 1) or many (categorie 2) animals outside.&lt;/P&gt;&lt;P&gt;So yes, it would be much easier if i could model NumOut/ NumInBucht but i would lose all observations where i don't know the exact number of animals outside. And that would be more often the observations with lots of piglets outside because it is easy to count 2 animals but not more than ten in a huddle.&lt;/P&gt;&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;Julika&lt;/P&gt;</description>
      <pubDate>Sun, 21 Nov 2021 15:25:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-model-multinomial-outcome-in-proc-glimmix/m-p/781553#M38386</guid>
      <dc:creator>JulikaW</dc:creator>
      <dc:date>2021-11-21T15:25:00Z</dc:date>
    </item>
    <item>
      <title>Re: How do I model multinomial outcome in proc glimmix</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-model-multinomial-outcome-in-proc-glimmix/m-p/781581#M38392</link>
      <description>&lt;P&gt;Okay. Well, it is always best to avoid using the ESTIMATE or CONTRAST statement whenever other statements that don't require specifying coefficients can do what you want. Most goals can be accomplished with the LSMEANS, SLICE, or LSMESTIMATE statement. So, I suggest you drop all of your ESTIMATE statements and add a STORE statement in your GLIMMIX step. Then use the LSMEANS statement in PROC PLM. For example:&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc glimmix data=final_f;
class tageszeit alter_tag bucht;
   model haeufigkeitskategorie = tageszeit alter_tag lufttemp niederschlag_stuendlich
/ dist=multi link = clogit oddsratio solution;
random intercept/ subject = bucht;
store mod;
run;
proc plm restore=mod;
lsmeans tageszeit alter_tag / ilink cl;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 21 Nov 2021 21:57:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-model-multinomial-outcome-in-proc-glimmix/m-p/781581#M38392</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2021-11-21T21:57:55Z</dc:date>
    </item>
    <item>
      <title>Re: How do I model multinomial outcome in proc glimmix</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-model-multinomial-outcome-in-proc-glimmix/m-p/782555#M38437</link>
      <description>Hallo Steve,&lt;BR /&gt;Thank You very much. Thats why i didn't find much Informations about the estimate Statement.&lt;BR /&gt;I'll try the plm.&lt;BR /&gt;Greetings, Julika</description>
      <pubDate>Fri, 26 Nov 2021 15:12:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-model-multinomial-outcome-in-proc-glimmix/m-p/782555#M38437</guid>
      <dc:creator>JulikaW</dc:creator>
      <dc:date>2021-11-26T15:12:30Z</dc:date>
    </item>
  </channel>
</rss>

