BookmarkSubscribeRSS Feed
sasrules
Fluorite | Level 6

I'm trying to create a mixed model with a multinomial outcome and a random effect.  I want to model the probability of a speech tag in a sentence coming at the beginning, middle, or end of a sentence, and I have a large sample of sentences.  The outcome can have three levels (beginning, middle, end), the only fixed effect is decade of publication, and I want to account for author as a random effect, since there are multiple sentences in the sample written by the same author.

 

I want to graph the predicted probability of each type of speech tag (beginning, middle, or end) by decade of publication.  I figured I could use LSMEANS to get the predicted probability of each outcome (beginning, middle, end).  But, I can't seem to figure out how to do this using SAS.

 

I've tried to use PROC LOGISTIC, PROC GENMOD, and PROC GLIMMIX.  PROC LOGISTIC won't take the random effect into account, but will give me the correct LSMEANS if I use link=glogit.  PROC GENMOD will account for the random effect but will not allow link=glogit, and I am not sure how to interpret the LSMEANS when link=cumlogit because the probabilities of the three outcomes do not add up to one.  PROC GLIMMIX won't allow LSMEANS for the multinomial distribution.  Attached are the codes I've tried.  Does anyone have any ideas?

 

 


Screen Shot 2016-03-05 at 4.12.45 PM.png
2 REPLIES 2
SteveDenham
Jade | Level 19

GLIMMIX is probably the way to proceed, but you will have to use the ESTIMATE statement to get your predicted probabilities.  See Example 45.13 in the SAS/STAT 14.1 documentation for an example of how to do this.  You'll have to adapt from a cumulative logit in the example to a generalized logit in your situation, and it requires the use of the %CONTRAST macro.

 

Steve Denham

sasrules
Fluorite | Level 6

Thank you so much for your help, Steve!  I had pretty much given up on being able to do this with SAS, but I'll take a look at the example you suggested.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 2779 views
  • 0 likes
  • 2 in conversation