Hello,
I want to fit a multilevel model for a multinomial outcome with unordered response categories.
Thus, I face exactly the same problem as described in following post:
It seems like there is no solution to this issue in proc glimmix.
However, I do not have to stick to proc glimmix but could also switch to another procedure. Do you have any hint for me how I could solve the problem in SAS?
Thanks in advance and kind regards,
M
I guess you need to take a look at PROC GEE . There is an alternative way to Generalize Logistic Model.
I would definitely consider @Ksharp's suggestion. If you have access to SAS/STAT14.1, take a look at Example 43.6 GEE for Nominal Multinomial Data for a kickstart. If you have additional random effects to consider, it will be easier to port to GLIMMIX once you have done this in GEE.
Now, if the measurements are truly hierarchical and not repeated in nature, the following is a good place to start (especially Example 2, even though that is for ordered responses):
http://support.sas.com/resources/papers/proceedings15/3430-2015.pdf
From there it is a matter of shifting to a generalized logit link, rather than a cumulative logit.
Steve Denham
Dear Mr Keshan, dear Mr Denham,
thanks for your hints.
I still have not found the best solution to my problem, so I returned to proc glimmix and tried this code for my outcome variable with 3 nominal categories and my binary predictor
proc glimmix data= data method=RSPL ;
class outcome predictor id;
model outcome(ref= first)= predictor/ dist=multinomial link=glogit ;
random predictor /sub=id group=outcome G type=UN;
NLOPTIONS TECH=nrridg;
Thereby I noted, that with ref= first, the G matrix is not positive definite and a wrong G Matrix is estimated:
Effect | predictor | Group | Row | Col1 | Col2 | Col3 | Col4 | Col5 | Col6 |
predictor | 0 | Outcome 0 | 1 | 5.25E-8 |
|
|
|
|
|
predictor | 1 | Outcome 0 | 2 |
| 5.25E-8 |
|
|
|
|
predictor | 0 | Outcome 1 | 3 |
|
| 0.5991 | -0.3839 |
|
|
predictor | 1 | Outcome 1 | 4 |
|
| -0.3839 | 0.2028 |
|
|
predictor | 0 | Outcome 2 | 5 |
|
|
|
| 0.9249 | 0.7053 |
predictor | 1 | Outcome 2 | 6 |
|
|
|
| 0.7053 | 1.2084 |
However, if I choose ref= last, the error does not occur and the G Matrix has the correct dimension:
Effect | predictor | Group | Row | Col1 | Col2 | Col3 | Col4 |
predictor | 0 | Outcome 0 | 1 | 0.6886 | 0.3393 |
|
|
predictor | 1 | Outcome 0 | 2 | 0.3393 | 0.9590 |
|
|
predictor | 0 | Outcome 1 | 3 |
|
| 0.5559 | 0.1235 |
predictor | 1 | Outcome 1 | 4 |
|
| 0.1235 | 1.3793 |
The last category has only 11% of all data, whereas the first category has 40% of all results.
Do you have any idea, why the error occurs and how I can prevent SAS from doing so?
Thanks in advance and kind regards,
M
I would really need to see a cross-tabulation to figure this out. It appears that there is no variability when ref='first' for something. This may be due to a single instance that causes this.
Steve Denham
If I create a frequency table for the outcome by id and predictor via
proc freq data= raw;
by id;
table predictor* outcome / out= freq;
run;
I find plenty of empty cells both outcome categories, for the first as well as for the last. I have attached the raw data set. Can you figure out the reason?
And another question: Is there any chance to get the estimate of the outcome independent of the predictor within the same model? Since predictor is a dummy coded variable, the intercept is not the mean of both predictor categories, but the estimate of the outcome for predictor=0.
Again, many thanks!
I'm still not sure about the main point here. Technical Support may be of a lot more help.
As far as the second question, I am having a spot of confusion in figuring out the question. Surely for all cases, you know what the predictor variable is--I don't think it is ever indeterminate. Thus, you should be able to get a predicted value for each category of the independent variable. Any "mixture" of values will depend on the sample/subpopulation/population ratio. If you had only a single independent variable, your model statement would look like:
model depvar=indvar / solution <other options go here>;
You could get an estimate of the sample value, ignoring the independent variable by fitting:
model depvar= / solution <make sure that the options are identical to the above>;
Steve Denham
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!
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.