BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
stodo53
Obsidian | Level 7

Hi all,

 

I have been running a proc mixed model with two categorical variables of interest: sex and state. 

 

IF state="technical missing" then state_cat='0';
IF state="not alive" then state_cat='1';
IF state="alive" then state_cat='2';

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;

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. 

 

P.S. I renamed the state_cat variable to state which is why state is being used in the mixed model. 

 

stodo53_0-1738754383499.png

 

Thanks in advance!

 

Sara

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

You cannot get coefficient estimates for a variable that has only 1 level.

--
Paige Miller

View solution in original post

3 REPLIES 3
PaigeMiller
Diamond | Level 26

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.

 

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.

 

IF state="technical missing" then state_cat='0';
IF state="not alive" then state_cat='1';
IF state="alive" then state_cat='2'; 

 

--
Paige Miller
stodo53
Obsidian | Level 7

This model would only run where p21 is not equal to missing, correct? Since that is the outcome. 

 

I ran this code:

proc freq;
where p21 ne .;
tables state;
run;

This was the output:

stodo53_0-1738755824659.png

So, I guess it must be because everyone is being classified in the same category and there is nothing to compare.

 

 

PaigeMiller
Diamond | Level 26

You cannot get coefficient estimates for a variable that has only 1 level.

--
Paige Miller

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 868 views
  • 3 likes
  • 2 in conversation