# Can count data be used as the independent variable in binomial logistic regression or poisson regression?

I have numerous independent variables (some binary, some count data) and am wondering if the count data variables can be used as the independent variable when running a binary log regression. I have read elsewhere that anything can be used as an independent variable, but have been getting unexpected odds ratio results. Is it because some of the count data variables have a lot of 0s? Is there any way to get around this (I was thinking maybe creating bins and creating dummy variables for each bin?).

Thanks in advance for any help!

• Yes, predictors in logistic regression work like with OLS regression, so most anything that can be used as a predictor in OLS can be used in a similar fashion in logistic regression (provided your sample is adequate to handle parsimonious binary outcomes - lots of empty outcome by predictors cells creates problems for logistic regression). If you describe your count variable more fully (e.g. bar chart), folks might be able to offer more guidance. – Bryan Mar 27 '18 at 0:16

Yes, you can use count data. However, from your brief description, it sounds as though your independent variables may be differently distributed (perhaps a case of zero-inflation, where the counts follow a distribution, but there are extra zeros in the overall distribution). In my experience, one way to address this is to introduce a grouping variable into your model.

The new variable is ZERO which is 1 if the count variable (let's call it X) is zero and 0 otherwise. Then, you can run the model using both ZERO and X as predictors. Essentially, you end up with two predictor equations in one: if ZERO = 1, it gives the average prediction for a zero count; if ZERO = 0, it gives the average prediction based on the actual count values.

Hope this helps.

• Hi Gregg, that is a really interesting solution. Thanks so much for your help on this one. – lrosen Mar 28 '18 at 18:10
• Just a quick question: when I run the regression for these two variables, should I be running the predictors separately or together? If I run them together, would they influence each other? – lrosen Mar 28 '18 at 18:20
• This approach requires both variables be entered into the model at the same time. Again, the zero assignment for each variable turns on/off the coefficient associated with that variable. (If ZERO is 1, X will be 0 and if ZERO is 0, X will not be 0.) – Gregg H Mar 28 '18 at 18:38
• Okay thanks @GreggH, that makes sense. When I am looking at the output then after entering them together, which odds ratio should I be interpreting? The ZERO variable, or the X variable? I understand how to interpret the zero variable, but because the X variable still has all the zeroes should I even be trying to interpret it? Again, thanks for your help on this! – lrosen Mar 28 '18 at 23:33
• For the count variable, the odds-ratio indicates the amount of expected difference between individuals with a count difference of 1. Say the coefficient is 0.0953, then the odds-ratio is 1.1. This means, if my count is 5, someone with a count of 6 will have 10% more chance of an observed success. Same with a count of 10 compared to 11, and so on. – Gregg H Mar 28 '18 at 23:39