BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
SASuser11466
Calcite | Level 5

Hello everyone:

I am a novice to multi level modeling and have a program running using Proc GLIMMIX. Its a two level model, relatively straightforward, several covariates (from survey data), country level is the 2nd level.

Things look ok however, I have requested odds ratios and am getting strange output. Instead of the nice, clean usual output screen you get from say, PROC LOGISTIC, I seem to be getting a matrix that makes it hard to tell the odds ratio for each variable. I also have a few ordinal variables in the model and it seems SAS is giving me an odds ratio for EACH level of the variable (unlike PROC LOGISTIC that gives one odds ratio for each unit increase in the ordinal variable)?

Any ideas or easy-to-read sources for a new GLIMMIX user? Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
SteveDenham
Jade | Level 19

This is kind of working the long way around, but what about putting the odds ratio and any other results into datasets using ODS output, and then manipulating the datasets to pretty it up to what you need?

Steve Denham

View solution in original post

8 REPLIES 8
Reeza
Super User

Are you including the variable in the Class statement or is it in an interaction term with another categorical variable?

SASuser11466
Calcite | Level 5

Thank for for getting back to me.  The ordinal variable is not in the class statement. I can see the results but everything is in a matrix format that makes interpretation difficult almost like SAS is trying to contrast every variable against each other variable and not presenting fixed effects and odds ratios in one table as with Proc Logistic. If it helps, code is below. (yes, I am a sociologist, running quite a few variables in the model) The outcome is binary (0/1) and LOGPPP is a second level variable for country purchasing power parity (logged), along with country for each country,  RELATTEND, SOCLASS, and CHILD are ordinal variables. All others are dummy coded categorical variables.  Again, thanks for the response. I tried the HLM software, did not care for it, and just started with Proc GLIMMIX. 

proc GLIMMIX data  = WORK.NEWISLAM;

class COUNTRY FREEBINARY PERFBEL BRELSAL RELPER GENDER AGECATS MARCATS EDUCATS INCATS;

model NDCHLD (descending) = LOGPPP FREEBINAR

PERFBEL BRELSAL RELATTEND RELPER

GENDER AGECATS MARCATS

EDUCATS INCATS SOCLASS CHILD

/ dist=binary link=logit ddfm=bw solution;

random int / subject=COUNTRY solution;

RUN; QUIT;


Reeza
Super User

Try adding the oddsratio option in the model statement. Let me know if that helps.

proc GLIMMIX data  = WORK.NEWISLAM;

class COUNTRY FREEBINARY PERFBEL BRELSAL RELPER GENDER AGECATS MARCATS EDUCATS INCATS;

model NDCHLD (descending) = LOGPPP FREEBINAR

PERFBEL BRELSAL RELATTEND RELPER

GENDER AGECATS MARCATS

EDUCATS INCATS SOCLASS CHILD

/ dist=binary link=logit ddfm=bw solution oddsratio;

random int / subject=COUNTRY solution;

RUN; QUIT;

SASuser11466
Calcite | Level 5

Thanks Again Reeza but I did add odds ratio and with/without issue remains the same. All output, (even fixed effects) are displayed in matrix form as shown below. Just wish I'd get the standard results table as with other regression commands (Proc logistic, GLM, etc.) Thanks again for taking the time. I apperciate it!

                                                 Solutions for Fixed Effects

           Measure

           of

           Perfect

           Belief    Binary                             Respondent'

           vs.       Religious  Religious   Respondent  s Age: 3     Marital   Education  Income                Standard

Effect     Skeptics  Salience   Person?     Gender      Categories   Status    level      Categories  Estimate     Error     DF

Intercept                                                                                               0.5789    0.2787      5

PERFBEL    aSkeptic                                                                                     0.1944   0.07643      5

PERFBEL    bPerfBel                                                                                          0         .      .

BRELSAL              aVeryImp                                                                          -0.1164    0.1538      5

BRELSAL              bNotImp                                                                                 0         .      .

RELATTEND                                                                                             -0.02074  0.008409  10416

RELPER                          aReligious                                                             0.08591   0.06756      5

RELPER                          bNon-Relig                                                                   0         .      .

GENDER                                      aMALE                                                      -0.3295   0.04662      5

GENDER                                      bFEMALE                                                          0         .      .

AGECATS                                                 a15-29                                        -0.01795   0.05986     10

AGECATS                                                 b>50                                          0.001864   0.06272     10

AGECATS                                                 c30-49                                               0         .      .

MARCATS                                                              aMarried                          0.02945   0.06712     10

MARCATS                                                              bOthr                              0.2188    0.1149     10

MARCATS                                                              cNvrMar                                 0         .      .

EDUCATS                                                                        aLow                   -0.08205   0.05243     10

EDUCATS                                                                        bHigh                  -0.06086   0.06146     10

EDUCATS                                                                        cMedium                       0         .      .

INCATS                                                                                    aLow          0.1000   0.04951     10

INCATS                                                                                    bHigh         0.1094   0.05678     10

INCATS                                                                                    cMedium            0         .      .

SOCLASS                                                                                                0.06797   0.02429  10416

CHILD                                                                                                 -0.02411   0.01297  10416

SteveDenham
Jade | Level 19

This is kind of working the long way around, but what about putting the odds ratio and any other results into datasets using ODS output, and then manipulating the datasets to pretty it up to what you need?

Steve Denham

SASuser11466
Calcite | Level 5

Thanks so much for the reply. SAS ODS is a very powerful tool, your insights are greatlyappreciated!  

lvm
Rhodochrosite | Level 12 lvm
Rhodochrosite | Level 12

You are not really getting a matrix of odds ratios or parameter estimates. You must be using proc format and informats to generate the detailed labeling.(Do you have a format statement in your code?) It looks like GLIMMIX spreads out the labels for the levels of the class factors. I tried this myself with some data, to confirm what happens with a format statement.  But if you look carefully, you have a single column of parameter estimates, with standard errors, not a matrix of parameters. Note that the last level of each class variable is 0 by definition. Same thing for the odds table that is generated with the oddsratio option.

Be careful in interpreting odds ratios in models with a mixture of class and continuous variables. The GLIMMIX documentation gives a thorough description.

SASuser11466
Calcite | Level 5

As with the previous response, THANKS ! so much. Everyone's assistance greatly appreciated.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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
  • 8 replies
  • 2372 views
  • 3 likes
  • 4 in conversation