[R] help using zeroinfl()

Achim Zeileis Achim.Zeileis at wu-wien.ac.at
Thu Jan 22 17:11:18 CET 2009


On Thu, 22 Jan 2009, Simon Pickett wrote:

> Hi all,
>
> I have been trying to use zeroinfl() with the pscl package with R 
> version 2.1.1.

That version is ancient, please upgrade.

> and with the newest versions of the contrib packages 
> compatible with R 2.1.1.

A version number for pscl would have been most helpful. I'm pretty sure 
that this is a version of "pscl" prior to the re-design of the count 
regression functionality, i.e., a version of the package which does not 
have the vignette you refer to. Surprisingly, the vignette applies to 
the version of the package which actually contains the vignette.

In any case, please use the most recent version of pscl.

> I have read the examples, the vignette and all the posts relating to 
> zeroinfl() but I am still confused as to how to structure the model.
>
> Here is a small example; the error message is the same for big data sets
>
> library(mvtnorm,lib.loc="C:/Documents and Settings/simonp/My Documents/R backup library")

Not needed here.

> library(pscl,lib.loc="C:/Documents and Settings/simonp/My Documents/R backup library")
>
> y<-c(0,0.2,0.4,0.7,0,0,0,0.8,0,0,0,0,0)

Non-integer counts are not allowed. (If these stem from division by some 
offset, please do not divide and use the offset instead.)

hth,
Z

> x<-c(3,4,5,2,3,6,3,7,4,8,5,8,3)
> m1<-zeroinfl(y~x|x)
>
> Zero-Inflated Count Model
> Using logit to model zero vs non-zero
> Using Poisson for counts
> Error in terms.formula(formula, data = data) :
>        argument is not a valid model
>
> Can anyone shed any light please?
>
> Simon.
>
> Dr. Simon Pickett
> Research Ecologist
> Land Use Department
> Terrestrial Unit
> British Trust for Ornithology
> The Nunnery
> Thetford
> Norfolk
> IP242PU
> 01842750050
>
> 	[[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.
>
>




More information about the R-help mailing list