Skip to content
Prev 19336 / 20628 Next

Question on glmmTMB

This should be fine. Unlike many mixed model packages, glmmTMB can 
handle models with no random effect.  When in doubt, you can just try 
out a comparison - this obviously isn't a 100% guarantee that something 
works reliably, but in this example all three approaches give very 
similar answers:

library(glmmTMB)
library(bbmle)
m1 <- glmmTMB(count~spp + mined, Salamanders, family=nbinom2)
m2 <- MASS::glm.nb(count~spp + mined, Salamanders)
m3 <- mle2(count ~ dnbinom(mu = exp(logmu), size = exp(logk)),
            parameters = list(logmu ~ spp + mined),
            start = list(logmu = 0, logk = 0),
            data = Salamanders)

library(broom)
library(broom.mixed)
tidy(m1)
tidy(m2)
tidy(m3)
On 6/18/21 4:10 AM, Ebhodaghe Faith wrote: