Dear list, I have recently encountered an odd error when running glm(dep~indep, quasipoisson): while, with a subset of my data, I could get a perfectly reasonable model, once I include all of my data (17K+ observations, 29 variables), I get the following error: Error in if (any(y < 0)) stop("negative values not allowed for the quasiPoisson family") : missing value where TRUE/FALSE needed In addition: Warning message: In Ops.factor(y, 0) : < not meaningful for factors I say this is odd because I triple checked my response variable, and not a single observation is negative. Is R encountering an error due to the size of the data, and somehow returning a 'random' error? (would be stranger still!) Thanks a million, hope this makes sense. Cheers, Wil
PS.: I tried the following solution http://markmail.org/message/353xeiqtqj6jwxsx , which basically rewrites the quasipoisson to 'obviate' negative values (when using that code, I assigned it to quasipoisson2, just in case). Either way, I got a different error, which suggests that something else is going on... Error in if (!(validmu(mu) && valideta(eta))) stop("cannot find valid starting values: please specify some", : missing value where TRUE/FALSE needed In addition: Warning message: In mean.default(y) : argument is not numeric or logical: returning NA Don't know if it helps... On Oct 19, 2010, at 00:55 , Wil M Contreras Arbaje wrote:> Dear list, > > I have recently encountered an odd error when running glm(dep~indep, > quasipoisson): while, with a subset of my data, I could get a > perfectly reasonable model, once I include all of my data (17K+ > observations, 29 variables), I get the following error: > > Error in if (any(y < 0)) stop("negative values not allowed for the > quasiPoisson family") : > missing value where TRUE/FALSE needed > In addition: Warning message: > In Ops.factor(y, 0) : < not meaningful for factors > > I say this is odd because I triple checked my response variable, and > not a single observation is negative. Is R encountering an error due > to the size of the data, and somehow returning a 'random' error? > (would be stranger still!) > > Thanks a million, hope this makes sense. > > Cheers, > > > Wil
Wil M Contreras Arbaje
2010-Oct-19 05:27 UTC
[R] [SOLVED] Re: Strange glm(, quasipoisson) error
Hi everyone, Please ignore my previous message: it turns out Excel, when saving as .csv, was somehow storing numerical values as text, and that was causing the error. I opened the .csv, changed all observations to --> Number type, and it worked w/o a hitch afterwards. Thanks, Wil On Oct 19, 2010, at 00:55 , Wil M Contreras Arbaje wrote:> Dear list, > > I have recently encountered an odd error when running glm(dep~indep, > quasipoisson): while, with a subset of my data, I could get a > perfectly reasonable model, once I include all of my data (17K+ > observations, 29 variables), I get the following error: > > Error in if (any(y < 0)) stop("negative values not allowed for the > quasiPoisson family") : > missing value where TRUE/FALSE needed > In addition: Warning message: > In Ops.factor(y, 0) : < not meaningful for factors > > I say this is odd because I triple checked my response variable, and > not a single observation is negative. Is R encountering an error due > to the size of the data, and somehow returning a 'random' error? > (would be stranger still!) > > Thanks a million, hope this makes sense. > > Cheers, > > > Wil
Possibly Parallel Threads
- R-equivalent Stata command: poisson or quasipoisson?
- quasipoisson, glm.nb and AIC values
- Comparing output from linear regression to output from quasipoisson to determine the model that fits best.
- extracting dispersion parameter from quasipoisson lmer model
- confidence bands for a quasipoisson glm