Search code examples
glmpoisson

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?


Solution

  • 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.