Although I don't think they apply it specifically in the context of GAMMs
Grosbois et al. 2008 Biological Reviews 83:357 (
http://onlinelibrary.wiley.com/doi/10.1111/j.1469-185X.2008.00047.x/full)
have some helpful thoughts on this and related issues (see particularly
section IV.5(a) for this topic).
hope that helps
rob


****** The new Bird Atlas is coming: http://www.bto.org/shop/bird-atlas
  *******

Dr Rob Robinson, Principal Ecologist
British Trust for Ornithology, The Nunnery, Thetford, Norfolk, IP24 2PU
Ph: +44 (0)1842 750050     E: rob.robinson@bto.org
Fx: +44 (0)1842 750030     W: www.bto.org/about-bto/our-staff/rob-robinson

====== "How can anyone be enlightened, when truth is so poorly lit" =======



On 3 December 2013 16:46, Julia Sommerfeld <Julia.Sommerfeld@utas.edu.au>wrote:

> 2013/12/3 Ben Bolker <bbolker@gmail.com>
>
> > On 13-12-03 07:58 AM, Julia Sommerfeld wrote:
> > > Hi Mari,
> > >
> > >
> > > 2013/12/3 Mari Lyly <mari.s.lyly@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 ...
> >
> >
> So, to calculate the % of deviance explained (DE%), you'd calculate:
>
> DN <- sum(residuals(model0$gam, type="deviance")^2)
>
> DR <- sum(residuals(model1$gam, type="deviance")^2)
>
> and then
>
> # Proportion of deviance explained
>
> DE% <- (DN-DR)*100/DN
>
> ?
>
> Julia
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-mixed-models@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>

	[[alternative HTML version deleted]]

