0
$\begingroup$

I'm trying to run a mixed model analysis and so far I've found two ways to write a negative binomial distribution model for my data:

m <- glmer.nb(two.percent~Management2+(1|Site/Farmer), 
              data=pollen_diversity,
              control=glmerControl(optimizer="Nelder_Mead",optCtrl=list(maxfun=100000000)),
              theta.ml = 1000)

and

m2 <- glmer(two.percent ~ Management2 + (1 | Site / Farmer), 
            family = negative.binomial(0.2), 
            data = pollen_diversity)

If I'm not mistaken, these should produce the same result. However, when I do a summary of each model after running them with the exact same data, I get drastically different results. In this case, the first model tells me each level of "Management2" is significantly different, and the second model tells me none of them are. I should add that the first model has other problems as well: it gives me many warnings when the data ("two.percent") aren't integers, and if they are integers it gives me a different warning as well as a completely different result.

What am I getting wrong?

$\endgroup$
2
  • $\begingroup$ I suppose my alternative question is: Is it okay to trust the second model? Since it produces no warnings and its results don't change when I round the input values to integers, I would really like to know I can trust it. $\endgroup$
    – Kat
    Commented Dec 12, 2018 at 21:57
  • $\begingroup$ What allows you to specify $\theta=0.2$ in the second model? It seems highly unlikely that would be the value found by the first. $\endgroup$
    – whuber
    Commented Dec 13, 2018 at 0:49

1 Answer 1

3
$\begingroup$

A couple of points:

  • In the first model you estimate the dispersion parameter of the negative binomial distribution whereas in the second one you fix it at 0.2. Hence, the two models are not equivalent.
  • The fact that you experience convergence problems may be attributed to fitting an overly complex model for your data. For example, it could be that you do not need the nested random effects. That is, the variance of the data between sites could be low (or practically zero) making it difficult for the algorithm to converge.
  • Function glmer.nb() fits the model using the Laplace approximation, which is known not to be that optimal. If you’re interested in the model without the nested random effect, you could also fit the same model using the adaptive Gaussian quadrature that offers a better approximation using the GLMMadaptive package. For examples check here.
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.