On Mon, 2011-04-11 at 11:18 -0500, ARISTIDES LOPEZ wrote: > Hello, > > I want make a GAM to describe the factors that influence the length > distribution of demersal fishes in the Colombian Caribbean Sea. The model > is like this: > gam(length~s(Lat)+s(Long)+s(depth)+s(temperature)+as.factor(rayni > season)+as.factor(botton),data=B. capriscus). My question is how can select > the type of distribution and the link of my model?
You *did* read ?gam, yes? >From there we have: family: This is a family object specifying the distribution and link to use in fitting etc. See ‘glm’ and ‘family’ for more details. A negative binomial family is provided: see ‘negbin’. And that points us to ?glm and ?family, so from ?glm: family: a description of the error distribution and link function to be used in the model. This can be a character string naming a family function, a family function or the result of a call to a family function. (See ‘family’ for details of family functions.) which also tells us to look at ?family for details, so we do, and we find all the information we need. Even a look at the examples for gam() in ?gam would have shown you what was involved. Or did you mean something else by "select"? In which case, I think you should think about what form the response takes: it is continuous but bound above zero as you can't have a zero length fish. In other words the response is strictly positive and continuous. A Gamma GLM would seem to be an appropriate starting point in that case. HTH G -- %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~% Dr. Gavin Simpson [t] +44 (0)20 7679 0522 ECRC, UCL Geography, [f] +44 (0)20 7679 0565 Pearson Building, [e] gavin.simpsonATNOSPAMucl.ac.uk Gower Street, London [w] http://www.ucl.ac.uk/~ucfagls/ UK. WC1E 6BT. [w] http://www.freshwaters.org.uk %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~% _______________________________________________ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology