Re: [R] interactions in GAMs

2012-11-27 Thread Simon Wood
David, I think that the colorsex approach is the right one, and colorsex should initially be included as a main effect, because the smooths are centred for factor by variables (see e.g. ?gam.models). Whether you then choose to drop this main effect, as it appears to be non-significant, is a m

[R] interactions in GAMs

2012-11-27 Thread chirleu
Hi all, I wonder if it's possible to include a double interaction in a GAM formula. Example: If I do this: mod=gam(energy~s(size, *by=color, by=sex*, k=5) + temperature, ...) I get the interaction betwen size*color and size*sex. But I need size*color*sex, being size a smoother. I've created a n