[R-sig-ME] Correct dispersion parameter for glmmML?
Gi-Mick Wu
mick.wu at mail.mcgill.ca
Mon Mar 30 03:38:32 CEST 2009
Thanks for the reply,
That was very useful. I removed one covariate, body size (and related interaction terms) to reduce/avoid overfitting. I kept the others because they are factors that I am really interested in. Here's the new model, which is much better I believe (no more really large coefficients):
################
> modl.glmmML.miss
Call: glmmML(formula = form, family = binomial, data = clean.dat.miss, cluster = clean.dat.miss[, "ID"], prior = "gaussian", method = "ghq", n.points = 8)
coef se(coef) z Pr(>|z|)
(Intercept) 0.535786 0.791211 0.6772 0.4980
Time -0.007409 0.012067 -0.6140 0.5390
Exposure -0.145812 0.283806 -0.5138 0.6070
Ordr -0.292222 0.956798 -0.3054 0.7600
Time:Exposure 0.001098 0.004114 0.2668 0.7900
Time:Ordr 0.020255 0.009289 2.1805 0.0292
Exposure:Ordr -0.135699 0.330928 -0.4101 0.6820
Scale parameter in mixing distribution: 0.568 gaussian
Std. Error: 0.2985
Residual deviance: 240.3 on 172 degrees of freedom AIC: 256.3
##############
As for the scale parameter, I am interested in it, because I would like to choose the appropriate test for null hypothesis testing (required in my field) according to Bolker et al.'s (2009) review in "Trends in Ecology & Evolution" (doi:10.1016/j.tree.2008.10.008). If I am reading it correctly (else please correct me), I should be using Wald Z or chi-square for models without overdispersion and Wald t or F for overdispersion when testing for fixed effects.
I was trying to calculate the correct dispersion parameter; was it already given to me as the "Scale parameter in mixing distribution"? (that would be too easy)
All the best,
Mick
________________________________________
From: Ken Beath [ken at kjbeath.com.au]
Sent: March 26, 2009 6:10 AM
To: Gi-Mick Wu
Cc: r-sig-mixed-models at r-project.org Models
Subject: Re: [R-sig-ME] Correct dispersion parameter for glmmML?
In your model fitting you have the intercept estimate large and with
large standard error and similarly for Ordr and maybe Exposure. This
is usually an indication of a problem with the fitting of binomial
data, probably separation due to overfitting. I would start with a
simple model and try and work out which terms are causing problems.
I prefer not to think about overdispersed GLMM, they seem a bit odd
statistically, maybe a GEE based approach is better.
Ken
On 25/03/2009, at 7:07 AM, Gi-Mick Wu wrote:
> Dear mixed model users, (my first post, after reading the archives a
> lot)
>
> This post is about mixed models, but not lmer or lme4; please let me
> know if it is inappropriate. (I have searched the archives for hours
> without finding an answer to my question. I have also searched and
> posted in "R-sig-eco" without results).
> Thank you in advance for reading!
>
> 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 the glmm model. Any one have an idea?
>
> Thanks in advance for reading and hopefully for some much needed
> answers or pointers.
> Mick
> PS In 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, but it is secondary, so it
> could be removed (to avoid overfitting).
>
> # R code for fitting the glmm
> form <- cbind(RewardOdour, UnrewardOdour) ~ (Time + NbExposure +
> Ordr + BodySize)^2
> # interaction terms limited to second order for parsimony
> 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
> Time -6.303e-03 0.0648177 -0.09724 0.9230
> Exposure 2.843e+00 2.3465958 1.21139 0.2260
> Ordr 4.366e+00 5.1119166 0.85401 0.3930
> BodySize 1.324e-02 0.0126869 1.04333 0.2970
> Time:Exposure 1.295e-03 0.0042982 0.30123 0.7630
> Time:Ordr 2.042e-02 0.0093118 2.19259 0.0283
> Time:BodySize -2.554e-06 0.0001093 -0.02337 0.9810
> Exposure:Ordr -2.333e-01 0.3489015 -0.66859 0.5040
> Exposure:BodySize -4.833e-03 0.0037688 -1.28235 0.2000
> Ordr:BodySize -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
>
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>
More information about the R-sig-mixed-models
mailing list