3

I was looking here for a R package to make an estimate on a general linear mixed effects model (Poisson family) with two random effects and (adaptive) Gaussian quadrature. I also need the full matrix of variance-covariance of the fixed and random estimates.

@Daniel advices me to use the mixed_model() function from the GLMMadaptive package.

I tried the mixed_model() function but the estimations I get are really different from the glmer() function.

Any feedback on this package? Or would you have other R packages to advise me in my situation?

Dimitris Rizopoulos
  • 17,519
  • 2
  • 16
  • 37
Flora Grappelli
  • 477
  • 2
  • 13

1 Answers1

2

Possible reasons why you get different results from the two packages include

  • The default of glmer() is the Laplace approximation and not the adaptive Gaussian quadrature. You could try refitting with glmer() and increase the nAGQ argument.
  • The optimization procedure in one of the two packages was not completely successful. You could try fitting the model with both functions by changing the defaults or providing better starting values.

In general generalized linear mixed models are more challenging models to fit, resulting in the observation you made. Therefore, it is advisable to study how each package works and suitably tweak the defaults.

Dimitris Rizopoulos
  • 17,519
  • 2
  • 16
  • 37
  • 2
    +1 for the insight and good advice. Your last observation suggests a useful diagnostic: using just one of the software platforms, evaluate the goodness of fit (perhaps as the log likelihood) of *both* solutions. If the difference is inconsequential, you're dealing with a challenging problem having multiple near-optimal solutions (which happens with mixture models); if the difference is large, then almost surely the two models differ and it's time to explore the documentation more fully. – whuber Jan 03 '20 at 15:08
  • 1
    I thought AQ was only available in `glmer()` for one random effect ? – Robert Long Jan 03 '20 at 15:53
  • @RobertLong it is available but it is *not* the default. The default is `nAGQ = 1`, which is the Laplace approximation. – Dimitris Rizopoulos Jan 03 '20 at 18:53