----------------------------------------------------------------------
Message: 1
Date: Mon, 19 Oct 2015 08:59:40 -0400
From: David Jones <david.tn.jones at gmail.com>
To: r-sig-mixed-models at r-project.org
Subject: [R-sig-ME] How to know if random intercepts and slopes are
necessary for glmer.nb model
Message-ID:
<CAJgUswL0mkbgpv-Xt1MsPtVbm9qGUZ+uaJ+wugPZw8Dvh-XcLA at mail.gmail.com>
Content-Type: text/plain; charset="UTF-8"
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]]