Christopher Desjardins
2012-May-05 16:06 UTC
[R] Getting predicted values from a zero-inflated negative binomial using zeroinfl()
Hi, I am a little confused at the output from predict() for a zeroinfl object. Here's my confusion: ## From zeroinfl package fm_zinb2 <- zeroinfl(art ~ . | ., data = bioChemists, dist = "negbin") ## The raw zero-inflated overdispersed data> table(bioChemists$art)0 1 2 3 4 5 6 7 8 9 10 11 12 16 19 275 246 178 84 67 27 17 12 1 2 1 1 2 1 1 ## The default output from predict. It looks like it is doing a horrible job. Does it really predict 7 zeros?> table(round(predict(fm_zinb2)))0 1 2 3 4 5 6 10 7 354 487 45 12 6 3 1 ## The output from predict using "count"> table(round(predict(fm_zinb2,type="count")))1 2 3 4 5 6 10 312 536 45 12 6 3 1 ## The output from predict using "zero", but here it predicts 24 "structural" zeros?> table(round(predict(fm_zinb2,type="zero")))0 1 891 24 So my question is how do I interpret these different outputs from the zeroinf object? What are the differences? The help page just left me confused. I would expect that table(round(predict(fm_zinb2))) would be E(Y) and would most accurately track table(bioChemists$art) but I am wrong. How can I find the E(Y) that would most closely track the raw data? Please cc me if you reply. Thanks, Chris [[alternative HTML version deleted]]