[R-sig-ME] empirical standard errors for glmer in lme4?

Ben Bolker bbolker at gmail.com
Mon Dec 17 17:15:29 CET 2012

john benson <smilodon2000 at ...> writes:


[quoting modified to trick gmane into letting me post]

# I am using generalized linear mixed models to investigate resource
# selection of animals in a wildlife population.  I've been using lme4
# and things have gone pretty well so far.  I'm exploring the
# selection/avoidance of landscape/environmental variables (fixed
# effects) based on locations that are used (coded 1) and available
# (coded 0) to/by the animals with logistic regression.  I've included
# random intercepts for individuals (to account for unbalanced sample
# size of telemetry locations) and social groups (to account for the
# fact that resource selection is likely similar between individuals
# within the groups).

> Basic model structure/code looks like this:

> M1<-glmer(y~x1+x2+....xn+(1|individual)+(1|group),data=data, 
>  family=binomial(link="logit"))

# I'm interested in using empirical standard errors for confidence
# intervals which I believe will be more conservative/appropriate than
# the model-based standard errors returned by lme4.  Additionally,
# previous researchers have noted concerns about the different
# correlation structure of used (spatially autocorrelated) and
# available (not autocorrelated) locations.  I was hoping to use HPD
# intervals for the model coefficients after generating MCMC samples.
# From extensive searching of the internet and reading many previous
# posts I'm confused about whether this is possible with the current
# version of lme4.  

> From reading previous posts it would appear that
> mcmcsamp function may not be currently enabled for lme4.

Correct (sort of): mcmcsamp has never worked (that I am aware)
for glmer models. See http://glmm.wikidot.com/faq#mcmcsamp_status

> My questions are these:

> 1. Is it possible to generate MCMC samples and HPD intervals with a
> glmer model using lme4?  If not, is it possible to this for a glmer
> in conjunction with another package, e.g. Coda?  Any help with
> packages and coding would be very helpful.

> 2. If it is not possible to get HPD intervals with glmer models does
> anyone have suggestions for other ways to generate empirical
> standard errors for glmer coefficients?  Its my understanding that
> Huber-White estimation is not possible with lme4....

> 3. Finally, if neither HPD or Huber-White is possible does anyone
> have any suggestions for generating confidence intervals around
> model coefficients of the fixed effects of a glmer model that would
> be both conservative/appropriate and help mitigate the problem of
> the different correlation structure of the used/available locations
> used as the response variable for my model.

  Have you exhausted the suggestions in the FAQ?  It sounds
like your problem might be suitable for many of the possibilities
listed there: switching to glmmADMB or MCMCglmm, or parametric
bootstrap, or ...  Perhaps you could try those, see how far you
get with one of them and re-post, or take a look at the options,
narrow down your choices, and re-post a more specific question?

  Ben Bolker

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