Re: [R-sig-eco] Poisson regression
-- Message: 2 Date: Thu, 24 May 2012 11:41:06 +0430 From: Mahnaz Rabbaniha To: r-sig-ecology Subject: [R-sig-eco] Poisson regression Message-ID: Content-Type: text/plain Dear all to find relation between non-normal response with independents variable i use this code: model1<-gam(Clupeidae~s(depth)+s(temperature)+s(salinity),poisson) the result shown is: There were 50 or more warnings (use warnings() to see the first 50) warnings(model1) Warning messages: 1: In dpois(y, mu, log = TRUE) : non-integer x = 2.079542 Error in cat(list(...), file, sep, fill, labels, append) : argument 2 (type 'list') cannot be handled by 'cat' what is meaning it? do i allow use it for continue? Check whether your Clupeidae variable contains non-integers... Alain thanks -- Dr. Alain F. Zuur First author of: 1. Analysing Ecological Data (2007). Zuur, AF, Ieno, EN and Smith, GM. Springer. 680 p. URL: www.springer.com/0-387-45967-7 2. Mixed effects models and extensions in ecology with R. (2009). Zuur, AF, Ieno, EN, Walker, N, Saveliev, AA, and Smith, GM. Springer. http://www.springer.com/life+sci/ecology/book/978-0-387-87457-9 3. A Beginner's Guide to R (2009). Zuur, AF, Ieno, EN, Meesters, EHWG. Springer http://www.springer.com/statistics/computational/book/978-0-387-93836-3 4. Zero Inflated Models and Generalized Linear Mixed Models with R. (2012) Zuur, Saveliev, Ieno. http://www.highstat.com/book4.htm Other books: http://www.highstat.com/books.htm Statistical consultancy, courses, data analysis and software Highland Statistics Ltd. 6 Laverock road UK - AB41 6FN Newburgh Tel: 0044 1358 788177 Email: highs...@highstat.com URL: www.highstat.com URL: www.brodgar.com ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
Re: [R-sig-eco] Poisson regression
On Thu, 2012-05-24 at 11:41 +0430, Mahnaz Rabbaniha wrote: > Dear all > > > to find relation between non-normal response with independents variable i > use this code: > > model1<-gam(Clupeidae~s(depth)+s(temperature)+s(salinity),poisson) I don't know if this is the problem or not, but you can't call the model that way. if you don't name arguments then you must list them in the order the function expects. You don;t say which `gam()` you use but assuming it is `mgcv:::gam()` then the second argument is `data` and you passed it a function `poisson`. Does it work if you do: model1<-gam(Clupeidae~s(depth)+s(temperature)+s(salinity), family = poisson) ? Really though you should be passing it both a data and a family argument. Assuming your data are in object named `mydata` then: model1<-gam(Clupeidae~s(depth)+s(temperature)+s(salinity), data = mydata, family = poisson) would be the correct way to work with the function. G > the result shown is: > > There were 50 or more warnings (use warnings() to see the first 50) > > warnings(model1) > Warning messages: > 1: In dpois(y, mu, log = TRUE) : non-integer x = 2.079542 Error in > cat(list(...), file, sep, fill, labels, append) : > argument 2 (type 'list') cannot be handled by 'cat' > > > what is meaning it? > > do i allow use it for continue? > > thanks -- %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~% 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