0

I am using lmer models to look at the effect of environmental predictor variables on a landscape variable. To do so, I'm using the dredge function to create a model candidate set of all possible combinations of predictor variables.

m3 <- lmer(div~scale(log(travel.time))+scale(spinsandplain)+scale(ThreeYearRain)+scale(claylake)+scale(ThreeYearRain)*scale(log(travel.time))+(1|circleID),na.action=na.fail,
          data=data, REML=FALSE)
s <-dredge(m3, extra = list("R^2"))
s

summary(get.models(s, 1)[[1]])  

I want to now pull out the confidence intervals of each variable from each of the top models. I can't seem to find any code, other than model averaging. Do you have the code? Is this not possible?

Thanks in advance, Leanne

THess
  • 1,003
  • 1
  • 13
  • 21

1 Answers1

2

get.models() returns a list of model objects of the same class as your global.model, so use e.g. confint or any relevant function on each item through lapply, sapply or a for loop.

For example: lapply(get.models(s, 1:10), confint)

Reproducible example:

library(glmmTMB)
library(MuMIn)

# from example(glmmTMB)
m2 <- glmmTMB(count ~ spp + mined + (1|site), family=nbinom2, data=Salamanders))
models <- get.models(dredge(m2), TRUE)

# list of CI for each model's parameters:
lapply(models, confint)
Kamil Bartoń
  • 1,482
  • 9
  • 10
  • @LeanneGreenwild It would be useful to have some details explaining how "does not seem to be working". I've added a reproducible example to my answer. – Kamil Bartoń Mar 24 '21 at 12:09