[R] opposite estimates from zeroinfl() and hurdle()

Ben Bolker bolker at ufl.edu
Fri Oct 23 18:06:53 CEST 2009




Tord Snäll-4 wrote:
> 
> Dear all,
> A question related to the following has been asked on R-help before, but 
> I could not find any answer to it. Input will be much appreciated.
> 
> I got an unexpected sign of the "slope" parameter associated with a 
> covariate (diam) using zeroinfl(). It led me to compare the estimates 
> given by zeroinfl() and hurdle():
> [snip]
> 

The right thing to do in this case is to poke through the code of hurdle()
and zeroinfl(), but a simple (?) demonstration shows that hurdle()
and zeroinfl() are indeed reporting opposite values :

 hurdle reports  -log(p/(1-p)) = -qlogis(p), where p is the probability
of a zero count:

z = rpois(500,lambda=3)
z = (z[z>0])[1:90]
z = c(z,rep(0,10))
hurdle(z~1)  ##
-qlogis(0.1)
## zero coefficient always == -qlogis(0.1)

  zeroinfl reports  log(p/(1-p)), where p is the
zero-inflation:

z = rpois(90,lambda=3)
z = c(z,rep(0,10))
zeroinfl(z~1)  ##
qlogis(0.1)

tmpf = function() {
  z = rpois(90,lambda=3)
  z = c(z,rep(0,10))
  coef(zeroinfl(z~1))[2]
}

rr = replicate(1000,tmpf())

hist(rr,breaks=1000)
summary(rr)
qlogis(0.1)

  Perhaps it would be worth sending an e-mail to the
package maintainers to request a note to this effect in
the documentation, particularly if this a FAQ ...
-- 
View this message in context: http://www.nabble.com/opposite-estimates-from-zeroinfl%28%29-and-hurdle%28%29-tp26024735p26029131.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list