Now that I've posted an example (for a different purpose) at
How will random effects with only 1 observation affect a generalized linear mixed model?
(resulting in creating an account here, and being invited to ask more questions), I'd like to hear some reactions to that example on the more interesting questions of what justifies viewing the random effects model as superior to the one without random effects - note the group data is really NO NEW INFORMATION, as far as I can tell. Here's the sample data and the two models:
> foc10
# A tibble: 10 x 3
focal nvn vnhr
<fct> <int> <dbl>
1 AM 0 27.0
2 AY 0 3.01
3 BV 25 82.0
4 CB 0 0.489
5 CD 63 163.
6 CE 18 7.68
7 CG 0 1.65
8 CH 14 53.4
9 CM 0 0.997
10 CS 0 38.5
Now the model without random effect:
> summary(pp <- glmmTMB(nvn~offset(log(vnhr)),data=foc10,family="poisson"))
Family: poisson ( log )
Formula: nvn ~ offset(log(vnhr))
Data: foc10
AIC BIC logLik deviance df.resid
111.5 111.8 -54.7 109.5 9
Conditional model:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -1.14680 0.09129 -12.56 <2e-16 ***
and now WITH the random effect - every observation in a separate group
> summary(pp <- glmmTMB(nvn~offset(log(vnhr))+(1|focal),data=foc10,family="poisson"))
Family: poisson ( log )
Formula: nvn ~ offset(log(vnhr)) + (1 | focal)
Data: foc10
AIC BIC logLik deviance df.resid
54.1 54.7 -25.0 50.1 8
Random effects:
Conditional model:
Groups Name Variance Std.Dev.
focal (Intercept) 5.088 2.256
Number of obs: 10, groups: focal, 10
Conditional model:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -2.692 1.166 -2.309 0.0209 *
Note the difference in AIC.