Carrie Perkins
Carrie Perkins

Reputation: 139

GLM Poisson thinks I have negative values in my dataset, throws error

I am trying to do a poisson GLM, and yet I continue to get this error

Poisson1 <- glm(Number.Flowers ~ Site, data = Flowering2, family="poisson")

Error in eval(family$initialize) :negative values not allowed for the 'Poisson' family

My data is count data and so is all positive values and zeros. What could be going on?

Is it possible for my CSV file to contain hidden negative values?

Upvotes: 0

Views: 2022

Answers (1)

Mox
Mox

Reputation: 531

It's possible your CSV might be flawed in some way. Try a different method of importing it into R (fread, read.table, etc). Check for NA or NaN issues. Compare the number of rows.

Upvotes: 1

Related Questions