<?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 Issue with producing estimates for categorical variable using PROC MIXED in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Issue-with-producing-estimates-for-categorical-variable-using/m-p/958343#M83904</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been running a proc mixed model with two categorical variables of interest: sex and state.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;IF state="technical missing" then state_cat='0';&lt;BR /&gt;IF state="not alive" then state_cat='1';&lt;BR /&gt;IF state="alive" then state_cat='2';&lt;BR /&gt;&lt;BR /&gt;PROC MIXED DATA=P21_ METHOD=REML;
TITLE "Outcome: P21, Exposure:sex";
CLASS state (REF='0') days_cat sex (REF='0');
MODEL p21=sex days sex*days state / SOLUTION CL;
REPEATED days_cat / SUBJECT=subject TYPE=SP(pow)(days_cat);
/*RANDOM days int / sub=subject;*/
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I have three levels of the "state" variable, however the results produced don't have any estimates for the state variable. Why could this be? State "2" is in the model, however everything is blank. I had no issues with the variable sex, where 0 (male) is the reference.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;P.S. I renamed the state_cat variable to state which is why state is being used in the mixed model.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="stodo53_0-1738754383499.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/104357i1A0620D6F874F4DB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="stodo53_0-1738754383499.png" alt="stodo53_0-1738754383499.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sara&lt;/P&gt;</description>
    <pubDate>Wed, 05 Feb 2025 11:36:24 GMT</pubDate>
    <dc:creator>stodo53</dc:creator>
    <dc:date>2025-02-05T11:36:24Z</dc:date>
    <item>
      <title>Issue with producing estimates for categorical variable using PROC MIXED</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Issue-with-producing-estimates-for-categorical-variable-using/m-p/958343#M83904</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been running a proc mixed model with two categorical variables of interest: sex and state.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;IF state="technical missing" then state_cat='0';&lt;BR /&gt;IF state="not alive" then state_cat='1';&lt;BR /&gt;IF state="alive" then state_cat='2';&lt;BR /&gt;&lt;BR /&gt;PROC MIXED DATA=P21_ METHOD=REML;
TITLE "Outcome: P21, Exposure:sex";
CLASS state (REF='0') days_cat sex (REF='0');
MODEL p21=sex days sex*days state / SOLUTION CL;
REPEATED days_cat / SUBJECT=subject TYPE=SP(pow)(days_cat);
/*RANDOM days int / sub=subject;*/
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I have three levels of the "state" variable, however the results produced don't have any estimates for the state variable. Why could this be? State "2" is in the model, however everything is blank. I had no issues with the variable sex, where 0 (male) is the reference.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;P.S. I renamed the state_cat variable to state which is why state is being used in the mixed model.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="stodo53_0-1738754383499.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/104357i1A0620D6F874F4DB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="stodo53_0-1738754383499.png" alt="stodo53_0-1738754383499.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sara&lt;/P&gt;</description>
      <pubDate>Wed, 05 Feb 2025 11:36:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Issue-with-producing-estimates-for-categorical-variable-using/m-p/958343#M83904</guid>
      <dc:creator>stodo53</dc:creator>
      <dc:date>2025-02-05T11:36:24Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with producing estimates for categorical variable using PROC MIXED</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Issue-with-producing-estimates-for-categorical-variable-using/m-p/958347#M83905</link>
      <description>&lt;P&gt;This happens because you don't have enough data in your study to estimate all model terms. You either need more data, or you need to remove terms from the model.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, unrelated to the above, this piece of code doesn't seem to be useful, you normally don't want to replace meaningful words with non-meaningful numbers, this just makes the output harder to read and harder to understand.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;IF state="technical missing" then state_cat='0';
IF state="not alive" then state_cat='1';
IF state="alive" then state_cat='2';&lt;/CODE&gt;&amp;nbsp;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Feb 2025 11:43:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Issue-with-producing-estimates-for-categorical-variable-using/m-p/958347#M83905</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2025-02-05T11:43:23Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with producing estimates for categorical variable using PROC MIXED</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Issue-with-producing-estimates-for-categorical-variable-using/m-p/958349#M83906</link>
      <description>&lt;P&gt;This model would only run where p21 is not equal to missing, correct? Since that is the outcome.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I ran this code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc freq;
where p21 ne .;
tables state;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This was the output:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="stodo53_0-1738755824659.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/104360iA07141675FD6F629/image-size/medium?v=v2&amp;amp;px=400" role="button" title="stodo53_0-1738755824659.png" alt="stodo53_0-1738755824659.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;So, I guess it must be because everyone is being classified in the same category and there is nothing to compare.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Feb 2025 11:44:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Issue-with-producing-estimates-for-categorical-variable-using/m-p/958349#M83906</guid>
      <dc:creator>stodo53</dc:creator>
      <dc:date>2025-02-05T11:44:23Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with producing estimates for categorical variable using PROC MIXED</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Issue-with-producing-estimates-for-categorical-variable-using/m-p/958350#M83907</link>
      <description>&lt;P&gt;You cannot get coefficient estimates for a variable that has only 1 level.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Feb 2025 11:55:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Issue-with-producing-estimates-for-categorical-variable-using/m-p/958350#M83907</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2025-02-05T11:55:34Z</dc:date>
    </item>
  </channel>
</rss>

