Skip to content
Prev 3079 / 7420 Next

Poisson regression

On Thu, 2012-05-24 at 11:41 +0430, Mahnaz Rabbaniha wrote:
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