Quantcast

ZI model problem

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

ZI model problem

juancho
I am trying to fit a zero-inflated model using zeroinfl() from the pscl library. I have 5 variables:

“agonCount” which is my response variable (numeric: frequency of aggressions).

“season” (factor, with 2 levels: wet and dry),

“subact”  (factor, with 2 levels: fe (feeding) and nfe (non-feeding))

“subclass”  (factor, with 3 levels: S –small-, M –medium- and L –large-)

“act2”  (factor, with 2 levels: immigrant and resident).

 

In order to run an analysis with ZI (Poisson or Negative Binomial) model I created a ZIP saturated and ZINB saturated model, but when I tried to run ZINB I get the following error:

 

Error in solve.default(as.matrix(fit$hessian)) :

  system is computationally singular: reciprocal condition number = 3.84232e-17

 

Thus, I can’t run lrtest (in order to compare the models and choice the better one) because a new error message appears.

 

The script I used was:

 

f1<-formula(agonCount~season+subact+subclass+act2|season+subact+subclass+act2)

 

Zip1 <- zeroinfl(f1, dist = "poisson",link = "logit", a)

summary(Zip1)

Zinb1 <- zeroinfl(f1, dist = "negbin",link = "logit", a)

summary(Zinb1)


I appreciate your time and input. Thank you
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: ZI model problem

Alisa Zhao
Hi Juancho,

Did you figure out why you had this error? This happened to me as well, though I only one categorical variable as my predictor. Thanks!

Alisa
Loading...