count.fit

This function compares four models for count responses, namely Poisson regression, negative binomial regression, zero-inflated Poisson regression, and zero-inflated negative binomial regression. To do so, it takes a Poisson regression model object (as specified via glm), and the range on the count outcome. This function mimics the countfit function developed in Long and Freese (2006).

For example:

library(catregs)
data("LF06art")
p1 <- glm(art ~ fem + mar + kid5 + phd + ment , family = "poisson", data = LF06art)
table(LF06art$art)
fit<-count.fit(p1,0:19)
names(fit)
#fit$ic
#fit$pic
#fit$models
#fit$models.pic


Try the catregs package in your browser

Any scripts or data that you put into this service are public.

catregs documentation built on Sept. 11, 2024, 6:18 p.m.