'Predicting from averaged mixed effects models - getting huge CI using sjPlot
I used MuMIn::model.avg to average several lme4::lmer models and I want to get and plot the predicted results from the averaged model. I tried using sjPlot::plot_model but I got unrealistic CI (ranging from about -50,000 to about +50,000 for a variable that has values ranging from 54-673).
I also tried to run similar models without the random factor, using simple linear models (lm) and got similar unrealistic CI.
Here is the code, I didn't add data because I don't think it is relevant but I can do it if required:
m1 <- lmer(Y ~ A*B + A*C + A*D + A*E + B*C + B*D + B*E + F + (1|RE), data = dt, REML = F)
dd <- dredge(m1, fixed = c("C","D","E","F"))
m1.avg <- model.avg(dd, fit = T)
plot_model(m1.avg, type="pred", terms = c("A","B")) #using different fixed effects still gives huge CI
# A,B - categorical variables with 2 and 3 levels, respectively
# C,D,E,F - continuous variables
I did find a way to solve this problem, but it makes calculation times much longer (and requires that I use scaled variables due to convergence issues which lmer does not have). Following this question I did everything using glmmTMB instead of lmer and then got the SE using predict and calculated the CI from it.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
