[R-sig-ME] glmer.nb(): Residual term ??

Christine Adrion adrion at ibe.med.uni-muenchen.de
Tue Apr 28 13:42:42 CEST 2015


Hello,

I fit a negative binomial GLMM using the lme4 package (version
lme4_1.1-7), R-function glmer.nb(). It seems that this is still an
experimental feature. The help function does not explain the residual term
in the resulting R output.

#---------------
# Reproducible example:
tmpf <- function() {
    x <- runif(400) - 0.5
    z <- gl(n=40, k=10)
    m <- model.matrix(~x + z)
    u <- rnorm(40, sd=0.5)
    eta <- m %*% c(0, 3, u[-1] - u[1])
    y <- rnbinom(n=length(eta), size=3, mu=exp(eta))
    data.frame(y, x, z)
}

set.seed(2011)
simdf <- tmpf()
m <- glmer.nb(y ~ x + (1|z), data=simdf)
m

##------------ output --------------------
Generalized linear mixed model fit by maximum likelihood (Laplace
Approximation) ['glmerMod']
 Family: Negative Binomial(6.7839)  ( log )
Formula: y ~ x + (1 | z)
   Data: ..2
      AIC       BIC    logLik  deviance  df.resid
 890.5451  906.5109 -441.2725  882.5451       396
Random effects:
 Groups   Name        Std.Dev.
 z        (Intercept) 0.3923
 Residual             0.9665
Number of obs: 400, groups:  z, 40
Fixed Effects:
(Intercept)            x
    -0.5511       2.5969
#-----------------------------------------

Unfortunately, it's not clear to me what the measure "Residual" exactly
expresses and thus why it is used by glmer.nb.


[BTW, the fitted dispersion parameter 'size' is not very close to the true
one (which was 3).]

Thanks for any help/explanation.

Kind regards
Christine



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