# The best distribution and regression method when modelling count data?

I am trying to fit a regression model where the dependent variable is number of messages received (MsgReceived in sample data below) by an individual/user, and the independent variables are a mix of count and binary variables like "TimeActive", "BioAvailable" etc.

Here, TimeActive is a count of weeks the user was active and BioAvailable is a 1-0 identifier stating whether the user has filled out his Bio

Here's some example data:

TimeActive,BioAvailable,X1,X2,X3,X4,X5,X7,X8,X9,X10,X11,Count1,Count2,Count3,MsgReceived

35,1,1,0,0,0,1,1,0,1,0,0,3,0,3,16
34,1,1,0,1,1,0,1,0,1,0,0,20,23,37,11
34,0,0,0,1,0,0,1,0,1,1,1,6,8,22,19
35,0,0,0,1,1,1,1,0,1,0,0,3,23,5,13
32,0,0,0,1,0,1,1,0,1,1,1,0,75,11,40
0,0,0,0,0,0,0,1,0,1,1,1,0,0,0,7
21,0,0,0,0,0,0,0,0,0,0,0,3,33,39,97
13,1,1,0,0,0,0,1,0,0,1,1,1,0,0,12
34,0,0,0,1,1,0,1,0,1,0,0,35,52,2,37
33,1,0,0,1,1,0,1,0,1,0,0,0,9,16,136
31,1,1,0,1,1,0,1,1,1,1,0,5,1,12,46
0,0,0,0,1,0,1,1,0,1,1,1,0,3,8,20
29,1,1,0,1,1,1,1,0,1,0,0,44,161,45,8


I am wondering if fitting a generalized linear model using a Poisson distribution is still the best fit even though the count of messages is over the life of a user's activity and not just a session. Assuming that a user's lifetime is a period seems fair. Is this correct? If not, what distribution and regression method would be a better fit?

• I've removed the tag "logistic", which seems quite irrelevant here. If I missed the point, please edit the posting to explain otherwise. (The use of a binary predictor is immaterial.) – Nick Cox Nov 28 '13 at 14:33

Another option is to fit quasiPoisson models with log link & dispersion parameter $\phi$. As for the Poisson GLM with log link, the expectation of the response is $\operatorname{E}(Y) =\mu$, where $\mu=\exp(\beta^\mathrm{T} x_)$, but its variance is $\operatorname{Var}(Y)=\phi\mu$. This doesn't affect the point estimates of the coefficients, but does their standard errors, & hence confidence intervals.

Another is to fit a Poisson GLM but use a robust estimate of the coefficients' variance–covariance matrix to calculate their standard errors, as @Nick suggests. Again, this doesn't affect the point estimates of the coefficients. Note that the assumption $\operatorname{Var}(Y)\propto\mu$ is still made during Fisher scoring: though estimates are consistent even if that's not true, they'll be closer on average for a given sample size if it is (this point was skated over rather in the otherwise very good article on the Stata blog). If the variance–mean relationship is clearly different you could use other GLMs with this estimating-equation approach; in practice, with count data, it tends to be hard to be sure of much more than that it's increasing.

It doesn't depend on whether the count is over a session or a lifetime. It depends on whether the assumptions of Poisson regression are met or not.

The one that usually causes problems is that, in Poisson regression, it is assumed that the conditional mean of the dependent variable equals the conditional variance. I have rarely found this to be the case, but it sometimes happens.

Usual generalizations of Poisson regression are negative binomial regression and zero-inflated versions of both.

• That assumption is secondary for Poisson regression. See blog.stata.com/tag/poisson-regression There is no need to fall back on more complicated models if the main idea of $y = \exp(Xb)$ is a good approximation. – Nick Cox Nov 28 '13 at 14:15
• @NickCox Well, the conclusions there were 1) to use vce(robust) which is Stata-specific and 2) that nbreg was robust to violations of assumptions. – Peter Flom Nov 28 '13 at 14:23
• Not sure of your first point: if it's that Stata offers a solution not matched by all other software, that isn't Stata's fault. I'd prefer Poisson regression to negative binomial regression if both worked equally well. More crucially, my main point is that the variance-mean proportionality is often invoked as more important than it really is in practice, just as an assumption of Gaussian error terms are often invoked as more important than it is for classical regression. – Nick Cox Nov 28 '13 at 14:31
• My first point was that the solution offered wouldn't generalize; I wasn't criticizing Stata (about which I know little). – Peter Flom Nov 28 '13 at 14:37
• Wouldn't generalize in what sense?. For "proportionality" in my previous comment please read "equality". – Nick Cox Nov 28 '13 at 14:46