[R-sig-eco] gam(mgcv)-interaction between smoothers

Gavin Simpson gavin.simpson at ucl.ac.uk
Fri Apr 17 18:36:48 CEST 2009


Maria Dulce Subida wrote:
> Hello all!
> 
>  
> 
> If I define a gam(mgcv) model with a bi-dimensional smoother  (say: Y ~
> s(X,Z) ) because I am quite sure that Y is being driven by the interaction
> of the smoothers s(X) and s(Z), am I obliged to include the main terms s(X)
> and s(Z) in the model (say Y ~ s(X,Z) + s(X) + s(Z) ) or am I free to enter
> them or not according to their significance in the model?

Depending on how you set up the smooth terms, the models may not be 
strictly nested, which may be an issue if you are testing for the 
interaction. Simon Wood's monograph on GAMs discusses this, and IIRC 
setting up tensor product smooths via te(X) + te(Z) + te(X,Z) was the 
same as te(X,Z) and te(X) + te(Z) was nested within te(X,Z).

You'll need to check the documentation and/or Simon's book to clarify 
the point about nested-ness, but to just fit the model, S(X,Z) is all 
you need, you don't need to include the "main" effects.

HTH

Gavin

> 
>  
> 
> Thanks for your help!
> 
>  
> 
>  
> 
> Maria Dulce Subida
> 
>  
> 
>  
> 
> 
> 	[[alternative HTML version deleted]]
> 
> _______________________________________________
> R-sig-ecology mailing list
> R-sig-ecology at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology



More information about the R-sig-ecology mailing list