[R-sig-eco] Correct dispersion parameter for glmmML?

Gi-Mick Wu mick.wu at mail.mcgill.ca
Thu Mar 19 19:27:49 CET 2009


Hi everyone, (my first post, after reading the archives a lot)

I hope I'm not asking an old question (I have searched hours on the internet and R help files, with no success)
I’m fitting a generalized linear mixed model to binary data using glmmML (version 0.81-4), but am unsure of how to obtain the correct dispersion parameter. (I have also just updated R to version 2.8.1)

For a glm model, I read that it should be the SS Pearson's residuals / df, rather than the default residuals (deviance). In my case:

# GLM
# using Pearson's residuals:
> sum(residuals(modl.glm,type="pearson")^2)/modl.glm$df.residual
[1] 1.062947
# using deviance
> modl.glm$deviance/modl.glm$df.residual
[1] 1.409863

For glmmML however, I cannot obtain the pearson residuals, but only the deviance and null deviance (same as deviance for glm):

# GLMM
# using Pearson's residuals
> residuals(modl.glmmML)
NULL
# using deviance
> modl.glmmML$deviance/modl.glmmML$df.residual
[1] 1.413364
# using null deviance
> modl.glmmML$cluster.null.deviance/modl.glmmML$cluster.null.df
[1] 1.409863

I am confused as to which (if any) of the dispersion parameter is valid for th glmm model. Any one have an idea?

Thanks in advance for reading and hopefully for some much needed answers.
Mick



PS Iin case it is relevant or for curiosity's sake, here's the experimental design:

The experiment consists in testing the effect of experience on odour preferences of parasitoid wasps. Parasitoids lay eggs in host insects, which will be devoured from the inside until they die; like the movie Alien :-)

Wasps were exposed to two different odours, with or without the presence of hosts (call them rewarded / unrewarded odour). Their odour preference was then tested in a Y-tube olfactometer 5 times after exposure (2h, 6h, 26h, 50h, 98h). 36 individuals were exposed to each odour either 1,2,3, or 4 times (9 individuals/treatment level). Odours were presented in alternation with half the wasps starting with the rewarded odour.
(Total number of binary choices = 180). I set Time and NbExposure as fixed effects because I'm really interested in their effect and wasp ID as random. I also added body size, which seem to play a role on the effect of experience in honeybees. I could argue it is overfitted... so I may remove body size (it is secondary).

# R code for fitting the glmm
form <- cbind(RewardOdour, UnrewardOdour) ~ (Time + NbExposure + Ordr + BodySize)^2   # interaction terms limited to second order
modl.glmmML <- glmmML(form, family=binomial, data=clean.dat,cluster=clean.dat[,"ID"],
			prior="gaussian", method="ghq", n.points=8)                            # same results with n.points = 20

> modl.glmmML

Call:  glmmML(formula = form, family = binomial, data = clean.dat, cluster = clean.dat[, "ID"], prior = "gaussian", method = "ghq", n.points = 8) 

                             coef            se(coef)      z           Pr(>|z|)
(Intercept)           -7.539e+00  7.5906651  -0.99324   0.3210
Interv                  -6.303e-03   0.0648177  -0.09724   0.9230
TrainExp                2.843e+00  2.3465958   1.21139   0.2260
TrainLastD             4.366e+00  5.1119166   0.85401   0.3930
TibiaL                    1.324e-02   0.0126869   1.04333   0.2970
Interv:TrainExp       1.295e-03   0.0042982   0.30123   0.7630
Interv:TrainLastD     2.042e-02   0.0093118   2.19259   0.0283
Interv:TibiaL           -2.554e-06  0.0001093  -0.02337   0.9810
TrainExp:TrainLastD -2.333e-01  0.3489015  -0.66859   0.5040
TrainExp:TibiaL       -4.833e-03   0.0037688  -1.28235   0.2000
TrainLastD:TibiaL    -7.487e-03   0.0086466  -0.86585   0.3870

Scale parameter in mixing distribution:  0.484 gaussian 
Std. Error:                                       0.3204 

Residual deviance: 237.4 on 168 degrees of freedom      AIC: 261.4



More information about the R-sig-ecology mailing list