Re: [R] Interactions in GAMMs

2010-07-21 Thread Gavin Simpson
On Wed, 2010-07-21 at 16:17 +0100, Karen Moore wrote: > Hi, > > I've an issue adding an interaction to a GAMM: > > My model was of form: > > gamm1 <- gamm(TOTSR ~ fROT + s(PH) + s(LOI) + s(ASP) + s(SQRT_ELEV) + CANCOV > + s(SQRT_TOTCWD) + s(WELLF) + s(WELLN) + s(OLDWDLD) + s(DISTWOOD) + > s(Annp

Re: [R] Interactions in GAMMs

2010-07-21 Thread David Winsemius
On Jul 21, 2010, at 11:17 AM, Karen Moore wrote: Hi, I've an issue adding an interaction to a GAMM: My model was of form: # Package? Probably: require(mgcv) gamm1 <- gamm(TOTSR ~ fROT + s(PH) + s(LOI) + s(ASP) + s(SQRT_ELEV) + CANCOV + s(SQRT_TOTCWD) + s(WELLF) + s(WELLN) + s(OLDWDLD)

Re: [R] Interactions in GAMMs

2010-07-21 Thread Vito Muggeo (UniPa)
Hi Karen, I think you should decide what you mean for "interaction". s(x:y) is meaningless If you want to fit a surface you should use s(x,y). If you want to fit a varying coefficient model (interaction between a linear and a smooth term) you should use the argument by in s(). The help file