How to know if random intercepts and slopes are necessary for glmer.nb model
Some relatively stream-of-consciousness thoughts: * what kind of errors? glmer.nb is still not as robust as we (or you!) would like, e.g. see <https://github.com/lme4/lme4/issues/319> ... information on the kinds of warnings & errors you're getting would be useful. * in general I would say that you should *try* to keep the random effects in if you can -- it is a bit of a catch-22 if you can't fit the models though ... * do you get similar results for simulated data with similar structure? * you could try alternative fitting platforms _or_ alternative models to account for dispersion, specifically * glmmADMB (could be slow for large data sets?) * glmmTMB (experimental! <https://github.com/glmmTMB/glmmTMB> ) (any other suggestions welcome ...) * using an observation-level random effect rather than NB to account for dispersion (in my experience these tend to give similar results: Harrison 2015 <https://peerj.com/articles/1114/> does a simulation study for the analogous case of overdispersed binomial models and concludes "use with caution ...")
On Mon, Oct 19, 2015 at 8:59 AM, David Jones <david.tn.jones at gmail.com> wrote:
I am receiving a number of different warnings/errors when running glmer.nb
on a fairly large dataset (N>500,000). For some of the models I have run,
program-reported errors prevent the generation of estimates. I suspect that
it is because the random effects are very small. I have tried models with
random intercepts, as well as models with both random intercepts and slopes
(all models include fixed effects). I am running models on a dataset which
in theory would include random effects (patients nested within hospitals).
My question is: how do you know if random intercepts and slopes are
necessary, if you can't even estimate the random effects models (and thus
use a model comparison test)? As I am aware you can look at design effects
to evaluate if a random intercept is necessary (though please correct me if
I am wrong here).
Some example code I have used is below - many thanks.
a2 <- as.factor(analysis$Location)
NBIntercept<- glmer.nb(y ~ a2 + (1 | Hospital), data = analysis)
NBInterceptSlope <- glmer.nb(y ~ a2 + (1 | Hospital) + (1 + a2 | Hospital),
data = analysis)
[[alternative HTML version deleted]]
_______________________________________________ R-sig-mixed-models at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models