0

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.

Don Cohen
  • 11
  • 2
  • I think I do understand why the random effect model is better. Poisson is a horrible fit to the data. Without the random effect, we have to find the best poisson parameter (mean) and then compute the loglik of each data point for that parameter. The random effect, lets us use a different poisson parameter for each data point at the cost of the loglik for the choice of the parameter. In this case the SD of the random effect is estimated as 2.25, which is about a factor of 10 in the poisson mean, and that's for a cost of about 2.2 in loglik. – Don Cohen Oct 27 '20 at 20:24
  • The interesting point is that this use of a random effect is completely different from the usual way random effects are conceptualized. – Don Cohen Oct 27 '20 at 20:24

0 Answers0