Lauria, Valentina
2013-Oct-18 16:42 UTC
[R] hurdle model error why does need integer values for the dependent variable?
Dear list, I am using the hurdle model for modelling the habitat of rare fish species. However I do get an error message when I try to model my data:> test_new1<-hurdle(GALUMEL~ depth + sal + slope + vrm + lat:long + offset(log(haul_numb)), dist = "negbin", data = datafit_elasmo)Error in hurdle(GALUMEL ~ depth + sal + slope + vrm + lat:long + offset(log(haul_numb)), : invalid dependent variable, non-integer values When I do fit the same model with round(my dependent variable) the model works. Sorry for the stupid question but could anyone explain me why? My data are zero inflated (zeros occurring for 78%) and positively skewed. Thank you very much in advance. Kind Regards, Valentina [[alternative HTML version deleted]]
Achim Zeileis
2013-Oct-18 17:57 UTC
[R] hurdle model error why does need integer values for the dependent variable?
On Fri, 18 Oct 2013, Lauria, Valentina wrote:> Dear list, > > I am using the hurdle model for modelling the habitat of rare fish > species. However I do get an error message when I try to model my data: > >> test_new1<-hurdle(GALUMEL~ depth + sal + slope + vrm + lat:long + offset(log(haul_numb)), dist = "negbin", data = datafit_elasmo) > > Error in hurdle(GALUMEL ~ depth + sal + slope + vrm + lat:long + offset(log(haul_numb)), : > invalid dependent variable, non-integer values > > When I do fit the same model with round(my dependent variable) the model > works. Sorry for the stupid question but could anyone explain me why? My > data are zero inflated (zeros occurring for 78%) and positively skewed.hurdle() fits a count data distribution (poisson, negbin, geometric) by maximum likelihood. Hence, its response needs to be a count variable (i.e., integer). See vignette("countreg", package = "pscl") for the underlying likelihoods employed.> Thank you very much in advance. > Kind Regards, > Valentina > > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >