[R-sig-ME] Problems fitting and interpreting glmmadmb and glmmTMB

Irene Rojo ire.rojo at gmail.com
Fri Apr 13 11:08:34 CEST 2018


 Hi,

I am trying to perform glmm analyses for fish density but I am getting
errors.. Also I am not an expert in statistics (at all) so I apologise if
my questions are too basic.

We sampled in 5 zones (ZN; fixed factor with 5 levels) and 3 protection
levels in each zone (PL; three levels). We selected 3, 6 and 9 sites (ST;
random effect) in each of the protection levels, respectively, and carried
out 3 underwater visual censuses in each site.

I am modeling counts of the most abundant species together as the response
variable, and including the area sampled as the offset term of the formula.
And I have so many zeros in my data.

I first tried the "glmer" function but it didn't work (model failed to
converge). Then I thought about the "zeroinfl" function but it doesn't deal
with random effects. It works well if I miss the random factor, but I don't
think that is right.

So I am trying to fit the models with the "glmmadmb" function as follows:

m0<- glmmadmb(nTRT10~  ZN*PL +
          offset(log(areaTRT10))
          + ( 1 | ST),
          data = den,
          zeroInflation = TRUE,
          family = "nbinom", link = "logit"
         )

I am getting a huge error, either for the poisson or nbinom families, which
I don't understand:

Parameters were estimated, but standard errors were not: the most likely
problem is that the curvature at MLE was zero or negative
Error in glmmadmb(nTRT10 ~ ZN * PL + offset(log(areaTRT10)) + (1 | ST),  :
  The function maximizer failed (couldn't find parameter file)
Troubleshooting steps include (1) run with 'save.dir' set and inspect
output files; (2) change run parameters: see '?admbControl';(3) re-run with
debug=TRUE for more information on failure mode
In addition: Warning message:
running command 'C:\Windows\system32\cmd.exe /c glmmadmb -maxfn 500 -maxph
5 -noinit -shess' had status 1

However, with glmmTMB function it seems to be working well.

m0<- glmmTMB(nTRT10 ~  ZN*PL + ZN + PL +
          offset(log(areaTRT10))
          + ( 1 | ST),
          data = den,
          zi=~ ZN + PL,
          family = nbinom2,
          dispformula = ~ PL
          )

And I get this output:

Family: nbinom2  ( log )
Formula:          nTRT10 ~ ZN * PL + ZN + PL + offset(log(areaTRT10)) + (1
| ST)
Zero inflation:          ~ZN + PL
Dispersion:              ~PL
Data: den

     AIC      BIC   logLik deviance df.resid
  1534.4   1626.1   -741.2   1482.4      226

Random effects:

Conditional model:
 Groups Name        Variance Std.Dev.
 ST     (Intercept) 0.09779  0.3127
Number of obs: 252, groups:  ST, 84

Conditional model:
            Estimate Std. Error z value Pr(>|z|)
(Intercept)  -6.0226     0.4126 -14.598  < 2e-16 ***
ZNCP          1.0949     0.4722   2.319 0.020405 *
ZNEF         -0.1117     0.5170  -0.216 0.828938
ZNMN         -1.8432     0.5088  -3.623 0.000291 ***
ZNTA         -1.0188     0.5224  -1.950 0.051162 .
PLBZ         -0.4027     0.5706  -0.706 0.480357
PLNT          1.1870     0.5262   2.256 0.024100 *
ZNCP:PLBZ     1.6528     0.6926   2.386 0.017015 *
ZNEF:PLBZ     1.8543     0.7333   2.529 0.011455 *
ZNMN:PLBZ     2.1438     0.7569   2.832 0.004624 **
ZNTA:PLBZ     1.4418     0.7361   1.959 0.050143 .
ZNCP:PLNT     0.4205     0.6577   0.639 0.522619
ZNEF:PLNT     1.2943     0.7438   1.740 0.081821 .
ZNMN:PLNT    -0.1311     0.7308  -0.179 0.857588
ZNTA:PLNT     0.6470     0.7057   0.917 0.359197
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Zero-inflation model:
              Estimate Std. Error z value Pr(>|z|)
(Intercept)    -0.6591     0.5512  -1.196   0.2318
ZNCP          -19.2792  5421.1935  -0.004   0.9972
ZNEF           -2.0983     0.9260  -2.266   0.0235 *
ZNMN          -17.8418  4982.4109  -0.004   0.9971
ZNTA          -20.4595 13048.1115  -0.002   0.9987
PLBZ            0.1975     0.7920   0.249   0.8031
PLNT           -0.8759     1.0086  -0.868   0.3852
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Dispersion model:
            Estimate Std. Error z value Pr(>|z|)
(Intercept) -0.16608    0.21679  -0.766    0.444
PLBZ         0.09037    0.30420   0.297    0.766
PLNT         0.62906    0.32911   1.911    0.056 .
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1



1. I don't understand the error in glmmadmb. Maybe the use of glmmTMB is
fine in this case so I don't need to use glmmadmb but still I am curious. Do
you think the use of glmmTMB is right here? I don't really understand the
differences among the two functions.

2. How can I perform model validation of glmmTMB? Is the same way as with
glmer?

3. How do I interpret the random effects conditional model?

Thank you so much,

Irene

	[[alternative HTML version deleted]]



More information about the R-sig-mixed-models mailing list