[R-sig-ME] How to calculate proportion of deviance explained from GAMM?

Ben Bolker bbolker at gmail.com
Tue Dec 3 17:02:57 CET 2013


On 13-12-03 07:58 AM, Julia Sommerfeld wrote:
> Hi Mari,
> 
> 
> 2013/12/3 Mari Lyly <mari.s.lyly at utu.fi>
> 
>> Hi Julia,
>>
>> I too thought of using GAMM for getting the null deviance, but I cannot
>> use deviance() function on the $gam bit of the GAMM (it returns 'NULL'). I
>> wonder if the sum of squared residuals of the null GAMM would be the same
>> thing as the null deviance? That is, I fit a GAMM and then calculate the
>> sum of squared residuals, as follows:
>>
>> data$rand <- 1
>> model0 <-gamm(response ~ 1, random=list(rand= ~ 1), data=data,
>> family=poisson)
>> DN <- sum(residuals(model0$gam, type="pearson")^2)
>>
>> Would it be ok to use that to get the null deviance (and the DE%)?

  Well, I would use the sum of squares of the *deviance* residuals for
that, not the sum of squares of the Pearson residuals ...



More information about the R-sig-mixed-models mailing list