[R] Extracting overdispersion estimates from lmer amd glm objects

David Barron mothsailor at googlemail.com
Tue Sep 12 10:26:54 CEST 2006


PS, the equivalent for a glm is:

> sum.modeltest <- summary(modeltest)
> sum.modeltest$dispersion

Hope this helps.

On 11/09/06, Toby Gardner <t.gardner at uea.ac.uk> wrote:
> Dear list,
>
> I am needing to extract the estimate of overdispersion (deviance / residual degrees of freedom or c-hat) from multiple model objects - so they can then be used to compare the extent of overdispersion among alternative models as well as calculate qausi-AIC values.  I have been unable to do this, despite consulting a number of manuals and searching the R-help.  I am imaging that in theory it should be possible with some call to attr(), but i have so far had no success.
>
> An example model output would be:
>
> > modeltest<-lmer(Coleodactylus_amazonicus_N~USD + (1|site),data=SFArray,family=poisson,method="Laplace",control=list(usePQL=FALSE, msVerbose=TRUE))
> > summary(modeltest)
>
> ------------
>
> Generalized linear mixed model fit using Laplace
> Formula: Coleodactylus_amazonicus_N ~ USD + (1 | site)
>    Data: SFArray
>  Family: poisson(log link)
>       AIC      BIC    logLik deviance
>  75.94996 81.68603 -34.97498 69.94996
> Random effects:
>  Groups Name        Variance Std.Dev.
>  site   (Intercept) 2.6076   1.6148
> number of obs: 50, groups: site, 5
>
> Estimated scale (compare to 1)  1.080798
>
> ------------
>
> What I need is to extract this value (1.080798) from multiple lmer objects.  Has anyone any recommendations? I also need to do this for glm objects although I suspect if someone was able to kindly point me in the right direction then the solution is likely to be similar.
>
> Very many thanks,
>
> Toby Gardner
>
> > sessionInfo()
> Version 2.3.1 (2006-06-01)
> i386-pc-mingw32
>
> attached base packages:
> [1] "datasets"  "graphics"  "grDevices" "methods"   "stats"     "utils"     "base"
>
> other attached packages:
>        JGR     iplots     JavaGD       lme4     Matrix    lattice       MASS      rJava
>    "1.4-7"    "1.0-3"    "0.3-4"  "0.995-2" "0.995-15"   "0.13-8" "7.2-27.1"    "0.4-6"
>
>
> School of Environmental Sciences
> University of East Anglia
> Norwich, NR4 7TJ
> United Kingdom
> Email: t.gardner at uea.ac.uk
> Website: www.uea.ac.uk/~e387495
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>


-- 
=================================
David Barron
Said Business School
University of Oxford
Park End Street
Oxford OX1 1HP



More information about the R-help mailing list