# count regression zero count comparison

3 messages
Open this post in threaded view
|

## count regression zero count comparison

 Hello, It might be more of a statistical question than an R question. I was reading http://cran.r-project.org/web/packages/pscl/vignettes/countreg.pdf, and I was wondering why the following functions were used to compare zero counts (observed and predicted), instead of just using hist(fitted(fm_pois),plot=FALSE), then the counts of the bin of 0 (which is simply count of 0 from fitted values). This is because I get nice zero counts using the following functions, but my fitted (predicted) values are rather off, so I was wondering what the following comparison means as supposed to the fitted values. R> round(c("Obs" = sum(dt\$ofp < 1), + "ML-Pois" = sum(dpois(0, fitted(fm_pois))), + "NB" = sum(dnbinom(0, mu = fitted(fm_nbin), size = fm_nbin\$theta)), + "NB-Hurdle" = sum(predict(fm_hurdle, type = "prob")[,1]), + "ZINB" = sum(predict(fm_zinb, type = "prob")[,1]))) Obs ML-Pois NB NB-Hurdle ZINB 683 47 608 683 709 Any comments would be appreciated. Thank you in advance. Sincerely, Jamie