Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Model selection for mixed effects models based on AIC

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)

1 Answers

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 ...)

like image 190
Ben Bolker Avatar answered Dec 09 '25 22:12

Ben Bolker



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!