3

I would like to fit a mixed effects model and get a list of the top ten candidate models ranked by AIC. For fixed effects models, I use the glmulti:glmulti function to fit the model and the glmulti:weightable function to get a list of candidate models ranked by AIC, which gives this output:

##                              model     aicc      weights
## 1          outcome ~ 1 + ist + hwt 188.3154 0.6044616289
## 2 outcome ~ 1 + ist + hwt + troadn 190.3552 0.2179837514
## 3                outcome ~ 1 + hwt 191.7862 0.1065837756
## 4       outcome ~ 1 + hwt + troadn 193.5704 0.0436764670
## 5                outcome ~ 1 + ist 195.8793 0.0137685009
## 6       outcome ~ 1 + ist + troadn 196.3339 0.0109688767
## 7             outcome ~ 1 + troadn 200.0687 0.0016949662
## 8                      outcome ~ 1 201.4210 0.0008620334

Is there an equivalent package to complete these same steps with a mixed effects model? I used the lme4::glmer function to fit a mixed effects model, but this does not produce a list of top models based on AIC score. Is there an alternate function/package, or is this process not used with mixed effects models?

I would like to get a list of top 10 candidate models for:

(outcome ~ sex + season + year  + (1 | obsname) + (1 | bird), data = detect, family = binomial)
Shawn Hemelstrand
  • 2,676
  • 4
  • 17
  • 30
  • 1
    You can do stepwise selection: https://stackoverflow.com/questions/55638476/how-to-do-stepwise-model-with-random-effect-lme4-lmertest ; I don't know if there is an analogue of all-subsets for random effect possibilities. – Ben Bolker Nov 17 '21 at 21:31

1 Answers1

2

It depends.

  • MuMIn::dredge() will fit all subsets of the fixed-effect component of a mixed model (?"MuMin-models" gives a complete list, including lmer and glmer objects among many others).
  • lmerTest::step() will do backward stepwise reduction (but not all-subsets fitting) of lmer models (but not glmer models). There is some discussion of/guidance on stepwise model reduction in the vignettes of the repsychling package (on GitHub), but not software to do it automatically.
  • LMERConvenienceFunctions::ffRanefLMER.fnc() does forward selection of random effects components.

I am not aware of any machinery to do automatic all-subsets evaluation of the random effects component of mixed models in R (which doesn't mean it doesn't exist ...)

Ben Bolker
  • 211,554
  • 25
  • 370
  • 453