gam questions
2. I've fitted a glm y~a+x+a:x, where a is a 3 level factor and x is a continuous covariate. If I want to fit a similar gam model, is it correct to fit y~a+s(x)+s(x,by=a.1)+s(x,by=a.2)+s(x,by=a.3), where a.1--a.3 are dummy variables representing each level of the factor? Or is the s(x) term redundant?
- yes the s(x) term is redundant and in the current mgcv version will likely cause spectacular nonsense as a result of lack of identifiability in the smooth part of the model (mgcv 0.9 will cope with this when released, but it's still much better to use an identifiable smooth model). Simon _____________________________________________________________________
Simon Wood simon at stats.gla.ac.uk www.stats.gla.ac.uk/~simon/
Department of Statistics, University of Glasgow, Glasgow, G12 8QQ
Direct telephone: (0)141 330 4530 Fax: (0)141 330 4814