[R] ANOVA within a GAMM framework

Simon Wood s.wood at bath.ac.uk
Mon Oct 22 16:23:21 CEST 2007


This comparison is just as valid as it is for a regular linear mixed model, 
which is all that the GAMM is in this case --- the smoothing parameters are 
just variance components in your example. 

In general you have to be a bit careful with generalized likelihood ratio 
tests  involving variance components, of course, since the null hypothesis 
often involves restricting some variance parameters to the edge of their 
possible range, which rather messes up the Taylor expansion about the null 
parameter values that underpins the large sample distributional results used 
in the glrt. Your example does involve such a problematic comparison, but the 
result is so clear cut here that there is not really any doubt that inv_2 is 
better in this case (I wonder if inv_1 even passes basic model checking?). 
See Pinheiro and Bates (2000) for more info. 

hope this is some use,
Simon


On Monday 22 October 2007 15:17, Maik Eisenbeiß wrote:
> Hi R user,
>
> I am using the gamm() function of the mgcv-package. Now I would like to
> decide on the random effects to include in the model. Within a GAMM
> framework, is it allowed to compare the following two models
>
>     inv_1<-gamm(y~te(sat,inv),data=daten_final, random=list(proband=~1))
>
>     inv_2<-gamm(y~te(sat,inv),data=daten_final, random=list(proband=~sat))
>
> with a likelihood ratio test for a traditional GLMM, like this:
>
> anova(inv_1$lme, inv_2$lme)
>
> The output is as follows:
>
>           Model df      AIC      BIC    logLik   Test  L.Ratio p-value
> inv_2$lme     1 10 21495.90 21557.59 -10737.95
> inv_1$lme     2  8 23211.12 23260.46 -11597.56 1 vs 2 1719.214  <.0001
>
>
> Or is this not in tune with the automatic smoothing parameter selection
> (i.e. it is not exactly the same for both model alternatives)?
>
>
> If not, how can I decide on the selection of random effects?
>
>
> Thanks in advance for your help.
>
> Best regards
> Maik
>
>
> Dipl.-Kfm. Maik Eisenbeiß
> Marketing Centrum Münster
> Institut für Anlagen und Systemtechnologien
> Westfälische Wilhelms-Universität Münster
> Am Stadtgraben 13–15
> 48143 Münster
>
> Telefon: +49 251 83-29920
> Telefax: +49 251 83-22903
>
> E-Mail: maik.eisenbeiss at uni-muenster.de
> Web: http://www.marketing-centrum.de/ias
>
> ______________________________________________
> R-help at r-project.org 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.

-- 
> Simon Wood, Mathematical Sciences, University of Bath, Bath, BA2 7AY UK
> +44 1225 386603  www.maths.bath.ac.uk/~sw283 



More information about the R-help mailing list