6
$\begingroup$

I am trying to wrap my head around mixed effects multilevel logistic regression. Have a look at my variables:

  • y: Popularity (0 = Not popular, 1 = Popular)
  • x1: Extraversion (Continuous)
  • x2: Teacher experience (0 = Low, 1 = High)

And here is my code and results:

library(lme4)
library(haven) 
library(tidyverse)
library(texreg)

# Load df
df <- read_sav(file ="https://github.com/MultiLevelAnalysis/Datasets-third-edition-Multilevel-book/blob/master/chapter%202/popularity/SPSS/popular2.sav?raw=true")

# Transform df
df <- df %>% 
  mutate(
    popular = case_when(
      popular < 5 ~ 0, # Not popular
      popular > 4 ~ 1, # Popular
    ),
    texp = case_when(
      texp < 15 ~ 0, # Low
      texp > 15 ~ 1, # High
    ) %>% as_factor())


model1 <- glmer(formula = popular ~ extrav + (1|class), 
      data = df, family = binomial(link = "logit"))

model2 <- glmer(formula = popular ~ extrav + texp + (1|class), 
                data = df, family = binomial(link = "logit"))

screenreg(list(model1, model2))

==================================================
                        Model 1       Model 2     
--------------------------------------------------
(Intercept)                -3.94 ***     -5.31 ***
                           (0.35)        (0.41)   
extrav                      0.81 ***      0.87 ***
                           (0.06)        (0.06)   
texp1                                     2.10 ***
                                         (0.32)   
--------------------------------------------------
AIC                      2220.24       2028.88    
BIC                      2237.05       2051.06    
Log Likelihood          -1107.12      -1010.44    
Num. obs.                2000          1893       
Num. groups: class        100            95       
Var: class (Intercept)      2.77          1.89    
==================================================
*** p < 0.001, ** p < 0.01, * p < 0.05

If this was a regular logistic regression, I would interpret model 2 as the following:

  1. Intercept: The log-odds of being popular are -5.31 when extraversion is 0 and teacher experience is 0.
  2. The log-odds (or logits) of being popular increases with 0.87 when extraversion increases by one (Teacher experience is hold constant)
  3. The log-odds of being popular are 2.10 higher if you are in a class with high teacher experience than one with low (extraversion hold constant).

Questions

  • Is this reading of the coefficients wrong when the model is mixed effects multilevel?
  • What can I make of this "Var: class (Intercept)"? Why does is decrease?
  • Imagine the intercept was insignificant in model 1 but turned significant in model 2. Why?
$\endgroup$

2 Answers 2

3
$\begingroup$

Is this reading of the coefficients wrong when the model is mixed effects multilevel?

No, it is the same except that fixed effects are conditional on the random effects so in this case they would refer to the same class, not averaged over all classes.

What can I make of this "Var: class (Intercept)"? Why does is decrease?

That's the variance of the random intercepts. Model 2 includes an additional fixed effect which "absorbs" some of that variance.

Imagine the intercept was insignificant in model 1 but turned significant in model 2. Why?

Again that could be due to the inclusion additional terms. But don't worry about statistical significance; that is based on arbitrary levels for p values (which are always conditional on the null hypothesis being true)

$\endgroup$
1
$\begingroup$

@Robert Long what would it mean if a variable was significant in the regular logistic regression, but no longer significant after a random effect is added in the mixed-effect model? What does that say about this variable that is no longer significant?

$\endgroup$
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.