[R] sigma in glmer (lme4)

Eric Elguero Eric.Elguero at mpl.ird.fr
Wed May 6 14:28:41 CEST 2009

dear R-users,

I am trying to understand what is the
sigma parameter returner by glmer

I thought it was (an estimate of) the sigma parameter
defined by Mc Cullagh & Nelder (e.g. p 126 of 2nd edition)
but I ran some simulations and it seems that this is
something else.

I simulated data corresponding to a binomial model,
intended to be fitted by this command:


but I instead fitted the following model:


(and repeated this process 500 times)

I expected sigma to be close to 1 but I found
that the mean sigma was about 0.05 (sd = 0.003)

If I do the analogous simulation study with glm,
that is, I simulate binomial data and fit them
with family=quasibinomial instead of binomial,
I find a mean dispersion parameter = 0.9999

changing parameters values does not alter this

In both cases, the fixed effects parameters are 
correctly estimated.

here is the function I used to simulate data (taking
0 as the standard deviation <sigmag> of random effect
provides data suitable to glm)

# sim.data.mixed
# simulates data for glmer
# Y is Binom(p,size)
# with logit(p) = theta1 + theta2*X + B
# where B is Norm(0,sigmag)
# x : the x values (same for each group)
# length(x) is the number of observations per group
# theta: the fixed effects parameters (intercept & slope)
# sigmag : the random effects standard deviation
# size : the binomial parameter (same for everybody)
# b (random effects) is returned here but not used by glmer

More information about the R-help mailing list