# How to compare mixed effect model with one random effect to one without random effect in R [duplicate]

Essentially comparing:

glm1 = glmer(Mortality ~ CCI + PatientRace + PatientSex + age_cat + (CCI | FacilityIdentifier),
data = tmp, family = binomial,
control = glmerControl(optimizer = "bobyqa"), nAGQ = 1)


to

m1 = glm(Mortality ~ CCI + PatientRace + PatientSex + age_cat,
family=binomial, data = tmp)


To determine if the random effect is a significant contributor, hopefully to show that each facility doesn't have varying practices in measuring CCI that may affect interpretation of mortality. Would appreciate any advice.

## marked as duplicate by amoeba, kjetil b halvorsen, Peter Flom♦Mar 6 '18 at 12:08

• Why not just bootstrap confidence intervals and see if that of the random effect's variance includes zero (non-significant) or not (significant)? You can simply do this with confint(glm1, method = "boot"). – Frans Rodenburg Mar 6 '18 at 5:45