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?
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;
Thanks! I tried this too, but it runs forever. Not sure if it is because of my computer or this model is too complex?
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.
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.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.