[R-sig-ME] Anova/deviance table in glmmADMB
Ben Bolker
bbolker at gmail.com
Wed Mar 21 20:28:20 CET 2012
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
[cc'ing to r-sig-mixed-models]
On 12-03-21 12:47 PM, Thomas Merkling wrote:
>
>
> Le 20/03/2012 22:43, Ben Bolker a écrit : On 12-03-20 02:32 PM,
> Thomas Merkling wrote:
>>>> Dear Ben and other list members,
>>>>
>>>> - Is there any way to produce a Anova/deviance table for a
>>>> model fitted with glmmADMB ? I used the Anova() function from
>>>> the car library for glmer models, but it does not seem to
>>>> work with glmmadmb (I'm using glmmADMB 0.7) and I would like
>>>> only one p-value for each term and interaction and NOT one
>>>> p-value for each level of the interaction.
> Hmmm.
>
> car::Anova() should work now -- I had to add a model.frame() and a
> df.residual() method for glmmadmb objects. (The df.residual
> number may be a little dodgy -- I'm not sure I counted the
> parameters right -- but I don't think it's actually used for much
> by default, cause you get Wald chi-square tests)
>
> The newest version of glmmADMB is 0.7.5.1 -- it may take a little
> while for r-forge to catch up, and I was having a few dependency
> issues. If you don't see it there in ~ 24 hours, drop me a line.
>> I used glmmADMB 0.7 because some models did not converge with
>> glmmADMB 0.7.2.4 ("function maximizer failed (couldn't find the
>> STD file)") and I read that with it might work with previous
>> versions ... which was the case .. until today .... Models that
>> were fitted without problem yesterday did not convernge today:
>> "Memory allocation error -- Perhaps you are trying to allocate
>> too much memory in your program" and "function maximizer
>> failed (couldn't find the STD file)"
Argh. (That's frustration with software and Murphy's Law, not with
you ...) What changed between yesterday and today? You could be
running out of memory simply because you have more large objects
loaded in your R session (or because you're doing something else
memory-intensive on your computer at the same time?), other than that
I don't have a good guess. If necessary you can squeeze memory a
little bit more by running glmmADMB within R to generate the
appropriate files, running the 'glmmadmb' executable outside of R,
then going back into R to read the results, but I find it very
annoying to work that way.
>
>> I was never able to download the package via
>
>> install.packages("glmmADMB",
>> repos="http://r-forge.r-project.org",type="source")
>
>> I got a warning :
>
>> In getDependencies(pkgs, dependencies, available, lib) : package
>> 'glmmADMB' is not available (for R version 2.14.2)
>
>> And on theR-forge packages page for the glmmADMB project
>> <https://r-forge.r-project.org/R/?group_id=847> the build status
>> is "Failed to build" and I never found any source package, but
>> maybe I was not looking at the right place ...
>
I am still fighting with R-forge. If necessary I will build some
more recent versions myself and put them up in the other repository space.
>> I will have a look tomorrow if things have changed ...
>
>
>>>> - I also tried to compare nested models via LRT using
>>>> anova(model1,model2) for glmmADMB models but I didn't get
>>>> any p-values, it produced NaN, although it apparently
>>>> calculate the differences in likelihood. Where can this come
>>>> from ?
> This ought to have worked: perhaps you had the models in the wrong
> order?
>> I think I did it right .... Here is an example
>
>> modmean=glmmadmb(MeanAggr~Date + Age+ Obs+
>> (1|Nest),family="Gamma",data=YESaggr,verbose=FALSE) modmean1=
>> glmmadmb(MeanAggr~Date + Age+
>> (1|Nest),family="Gamma",data=YESaggr,verbose=FALSE)
>
>> anova(modmean,modmean1) Analysis of Variance Table
>
>> Model 1: MeanAggr ~ Date + Age + Obs Model 2: MeanAggr ~ Date +
>> Age NoPar LogLik Df -2logQ P.value 1 9 -726.22 2 5
>> -731.23 -4 -10.012 Message d'avis : In pchisq(q, df, lower.tail,
>> log.p) : production de NaN
What do you get from anova(modmean1,modmean) ? In general the
*simpler* model should come first -- in more recent versions of
glmmADMB, the program will rearrange them for you (and warn you).
>
>> If is specify "test="Chisq"", I got this error message : Erreur
>> dans x$random : $ operator is invalid for atomic vectors
Yes, in this case glmmADMB is interpreting this argument as another
model you want to consider in the nested sequence.
>>>> - I tried to use the coefplot2 library (downloaded from
>>>> http://www.math.mcmaster.ca/bolker/R/src/contrib) as showed
>>>> on the glmmADMB home page ("getting started with glmmADMB"),
>>>> but I couldn't use it and got this error message : unable to
>>>> find an inherited method for function "coefplot2", for
>>>> signature "glmmadmb". Is it normal ? It worked fine with
>>>> glmer output.
> Can you try getting it from r-forge?
>
> Again, if the problem persists let me know.
>
> Ben
>
>> on theR-forge packages page for the coefplot2 project
>> <https://r-forge.r-project.org/R/?group_id=847> the build status
>> is offline and I got the same error message as for glmmADMB when
>> trying
>
>> install.packages("coefplot2",
>> repos="http://r-forge.r-project.org",type="source")
>
Double argh. I will try to get this back up.
Ben
>> Cheers, Thomas
>
>
>
>>>> Thanks for your help ! Thomas
>>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQEcBAEBAgAGBQJPaivUAAoJED2whTVMEyK92D0H/1OyF3jbQw3QFjeV3XBCBf51
V6lhoCfq4LFyzk5yp6rQG3VG+lSC1xmtc0kjAp9ei/OGYpb9Wogsqu53U8e3uurQ
J1z+3XRl7DDlmPcf2DDgrLHirQYa7TqwLIzmpY+g8qBM/qgMbY5RyAm0FuRB2lpj
jdBQebHQqKs9ZCa5bW8xBPD6kvNnoFm0H+aGrxORjHRyM1OI+4ye8zmTXHz3CwH/
8ZaPB6tWbd2h0Ga21YhH4EcTNoqGDs83uf/FGmJcwDtUoc+esOnQ3H/gvqAJdmv5
tz+6IZaQX3dPDzf6/H+bTI61c9lYnWphBPEWQDBFDLMccGDcUzH35GYulQGjJko=
=Vm7s
-----END PGP SIGNATURE-----
More information about the R-sig-mixed-models
mailing list