GLMM – Interpretation of Coefficients in Generalized Linear Mixed Models

glmminterpretationmixed modelr

There is something I'm not quite understanding conceptually about the output from generalized linear mixed models. I have read that the target of inference in GLMMs is subject-specific. For example, the accepted answer to this question states that in a logistic GLMM the odds-ratios are conditioned on both the fixed and random effects. So, in a GLMM of pupils within classrooms, with random intercepts for classroom (i.e., the "subject" in this case), the odds-ratios will differ for each classroom as there will be many random intercepts. So far, this makes sense to me.

What I am confused about is that the typical output from the fixed effects part of such a model reports just one odds-ratio. For example, in the R example I provide below, the odds-ratio for the fixed effect of sex is .662. I have three questions:

  1. How do I interpret this single fixed effect odds-ratio?
    (Is it an odds-ratio ignoring the random effects? Is it an odds-ratio of the average random effect – in which case, isn't it a population average? Is it calculated assuming the random effect variance is zero?)

  2. Is it possible to calculate a population average odds-ratio using the output from a GLMM?
    I know this can be done using a GEE, but what about a GLMM?

  3. How would I go about calculating the odds-ratio for a particular random effect (a particular classroom, lets say class 7 in the example below)?
    Presumably this involves combining the fixed and random effect estimates somehow.

EDIT 1:
It seems after doing more reading (for example, this post), that since the fixed effect for sex in this example does not have its own random effect (e.g., a random slope), there will be no subject-level interpretation of this parameter. Does this mean that only the intercept term in the model below is subject-specific, while the sex term is a population average?

# dummy data:
set.seed(1)
dat <- data.frame(Y         = factor(sample(rep(c(0, 1), 100))),
                  sex       = factor(sample(rep(c("M", "F"), 100))),
                  classroom = factor(sample(rep(paste("class", 1:10), 20)))
) 

# model:
library(lme4)
fit <- glmer(Y ~ sex + (1 | classroom), family=binomial, data=dat)

# summary(fit)
exp(fixef(fit))
# (Intercept)   sexM 
#  1.229       0.662 

Best Answer

I think I may have reached an understanding about this. The summary of the fixed effect coefficients from the model is (on the scale of the link function, here log-odds):

summary(fit)$coefficients

            Estimate Std. Error z value Pr(>|z|)
(Intercept)    0.206      0.222   0.927    0.354
sexM          -0.412      0.289  -1.426    0.154

These are the same estimates as when averaging over the random effects for intercept (the sex effect is constant). So, these fixed effect estimates (on the link scale) are population average effects:

coef(fit)

$classroom
         (Intercept)   sexM
class 1       0.1605 -0.412
class 10      0.3606 -0.412
class 2       0.2119 -0.412
class 3      -0.0294 -0.412
class 4       0.0281 -0.412
class 5       0.0855 -0.412
class 6       0.2237 -0.412
class 7       0.3090 -0.412
class 8       0.2119 -0.412
class 9       0.4990 -0.412

colMeans(coef(fit)$classroom)

(Intercept)   sexM 
0.206         -0.412

However, when the coefficients are transformed to odds-ratios this is no longer the case:

sapply(coef(fit)$classroom, exp)

(Intercept)  sexM
1.174        0.662
1.434        0.662
1.236        0.662
0.971        0.662
1.028        0.662
1.089        0.662
1.251        0.662
1.362        0.662
1.236        0.662
1.647        0.662

colMeans(sapply(coef(fit)$classroom, exp))

(Intercept)  sexM 
1.243        0.662

The intercept above (averaged over the exponentiated random effects) is not the same as the exponentiated fixed effect coefficient below, because exponentiation is not a linear transformation. But, the sex effect is the same, since this did not have a random effect associated with it. Therefore, the sex coefficient is a population average estimate, even as an odds-ratio:

exp(fixef(fit))

(Intercept)  sexM 
1.229        0.662
Related Question