0

I am using R version 3.6.0 and I am following this guide in order to run a zero-inflated poisson regression on cholera data: https://stats.idre.ucla.edu/r/dae/zip/

I have installed the pscl package as instructed, but when I run my code, an error message shows.

cholera2 <- within(cholera, {wateraccess <- factor(wateraccess, order=TRUE, levels=c(1,2,3,4))})

summary(cholera2)
summary(m1 <- zeroinfl(cases ~ wateraccess + atpc, data = cholera2))

I tried using a different version of R and it has the same issue.

Error message: Error in zeroinfl(cases ~ wateraccess + atpc, data = cholera2) : could not find function "zeroinfl"

Zookie
  • 1
  • 2
  • This function is probably from some package. You need to load the package via `library`. Not sure which package it comes from but given that you know the function, you probably can look up the package from the code where you found it. – lmo Jun 23 '19 at 22:09
  • Google says the function is in `pscl`. Did you use `library(pscl)`? It's not enough to install it, you need to attach it as well. – user2554330 Jun 23 '19 at 22:17
  • This is all covered on the page: `This page uses the following packages. Make sure that you can load them before trying to run the examples on this page. If you do not have a package installed, run: install.packages("packagename"), or if you see the version is out of date, run: update.packages().` – Marius Jun 24 '19 at 00:18

0 Answers0