-2*logLik() is the deviance, so you should be able to fill that into the
formula.  To get the null deviance you will need something like null.model
<- update(full.model, [formula including only an intercept term in the
fixed effects]).  It is up to you to decide what a 'sensible' null model is
-- i.e. whether it includes the random effects or not ...


On Wed, Jul 2, 2014 at 9:23 AM, Elena Guerrero <eguerrero@icm.csic.es>
wrote:

> Dear Ben,
>
> Thank you very much for your fast reply.
>
> I've tried: "-2*logLik(My glmmADMB)" and it gave me: 'log Lik.' 1854.08
> (df=7).
>
> How should I interpret this result? Is is possible to obtain a proportion
> % value of the explained deviance by the model?
>
> Thank you very much!
> All the best,
> Elena
>
>
> --
> Elena Guerrero Sánchez-Guerrero
> PhD student
> Dept. Biologia Marina i Oceanografia
> INSTITUTO DE CIENCIAS DEL MAR - CSIC
> Pg. Marítim de la Barceloneta, 37-49
> 08003 BARCELONA
> Spain
> Phone:(+34) 93 230 95 00 (ext. 1209)
> Fax: (+34) 93 230 95 55
> http://www.icm.csic.es/icmdivulga/es/mediterraneo-monograficos-08.htm
> http://www.icm.csic.es/bio/
>
> El 01/07/14 23:03, Ben Bolker escribió:
>
>    [cc'ing to R-sig-mixed-models]
>>
>>    There appears to be a deviance() method for 'admb' objects (produced
>> by R2ADMB), but not for 'glmmadmb" objects (produced by glmmADMB).
>> However, you should be able to use -2*logLik(object) to obtain the
>> deviance (to be precise, -2*logLik(object) is equal to the deviance in
>> general only _up to an additive constant_, but I think this workaround
>> will be OK for your purposes).
>>
>>    Ben Bolker
>>
>>
>> On 14-07-01 07:10 AM, Elena Guerrero wrote:
>>
>>> Dear Ben Bolker,
>>>
>>> I have run a glmmADMB model to my count data with a family = "nbinom" .
>>> It worked very nice.
>>>
>>> Now I want to calculate the *deviance explained* by this model
>>> (100*(Null deviance-Residual deviance)/Null deviance). I installed the
>>> R2admb package to use the deviance() function, however when I write
>>> deviance(my model) R gives me "NULL" as a response. When I try with the
>>> "admbex" example it works perfectly.
>>>
>>> What is it happening? What does mean NULL in this case? Is there any
>>> other way to obtain the explained deviance of a glmmADMB model?
>>>
>>> Thank you very much in advance.
>>> Best regards,
>>> Elena
>>>
>>> --
>>> --
>>> Elena Guerrero Sánchez-Guerrero
>>> PhD student
>>> Dept. Biologia Marina i Oceanografia
>>> INSTITUTO DE CIENCIAS DEL MAR - CSIC
>>> Pg. Marítim de la Barceloneta, 37-49
>>> 08003 BARCELONA
>>> Spain
>>> Phone:(+34) 93 230 95 00 (ext. 1209)
>>> Fax: (+34) 93 230 95 55
>>> http://www.icm.csic.es/icmdivulga/es/mediterraneo-monograficos-08.htm
>>> http://www.icm.csic.es/bio/
>>>
>>>
>

	[[alternative HTML version deleted]]

