[R] count regression zero count comparison

jekang jeeeun.kang at gmail.com
Tue Sep 13 21:14:35 CEST 2011


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. 



View this message in context: http://r.789695.n4.nabble.com/count-regression-zero-count-comparison-tp3810907p3810907.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list