BookmarkSubscribeRSS Feed
AprilS
Calcite | Level 5

I am trying to fit a multinomial logistic model with random effects (ID is the cluster) and a 3-level nominal outcome, the outcome is not ordinal. I used SAS code like below:

 

   proc glimmix;
      class ID outcome;
      model outcome(ref=first) = explanatory/
                      dist=multinomial 
                      link=glogit;
      random intercept / subject=ID group=outcome;
   run;

But the model did not work and said G matrix is not positive definite. I tried glogit model several times with different outcomes and clusters, it either runs out of memory or has other issues. I wonder if I did anything wrong or there is a better way to do this kind of models in SAS?

5 REPLIES 5
StatDave
SAS Super FREQ

You could instead try fitting a GEE model:

 

proc gee;
      class ID;
      model outcome(ref=first) = explanatory/
                      dist=mult link=glogit;
      repeated subject=ID;
   run;
AprilS
Calcite | Level 5

Thanks! I tried this too, but it runs forever. Not sure if it is because of my computer or this model is too complex?  

StatDave
SAS Super FREQ

Like all modeling procedures, the time and memory needed increases with the number of parameters in the model. So, you might want to start with a small model (few predictors) and see if you can build up to a suitable model. Note that the number of parameters will increase dramatically as the number of levels of the response increases. So, if there are many response levels, you might consider a modified response that merges categories into fewer levels.

AprilS
Calcite | Level 5
Thanks, the response just has 3 levels and I only used one predictor with 2
levels, the sample size is about 500. Then I guess it is just because of
the computer power? Besides the computer power, I am curious if there is
any statistical computation method which might help?

Thanks again!
StatDave
SAS Super FREQ

So, you really just have an Sx2x3 table, where S is the number of subjects. For that, you can use a nonmodel-based approach. You could use the CMH statistics in PROC FREQ with your subject variable as the stratifying variable. For example, if your 2 level predictor is X and your 3 level response is Y:

 

proc freq;
table s*x*y/cmh noprint;
run;

The second CMH statistic tests if X and Y are associated. See the discussion in the FREQ documentation for details.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 5 replies
  • 914 views
  • 0 likes
  • 2 in conversation