# Creating a Predictive Model with Binned Data

I have a health dataset with the number of drinks per month someone consumes, and many other variables that are binned. For example, 1: income less than \$10000, 2=income less than \$20000, and so on.

What would be the best way to create a model predicting the number of drinks consumed per month with these kinds of variables? If the income data was continuous I would normally try a regression.

• Linear regression has no assumption about your explanatory variables, only your residuals and outcome variable. Using factors like bins is fine as predictors. However, of number of drinks is a count then maybe a log linear model might be a better fit. – Jon Jul 29 '17 at 15:05
• If you are still curious about an answer, i have one in my own question asking mostly the same thing. – shadowtalker Apr 12 '18 at 20:40

You can treat this as a regression problem with a censored outcome (classical statistics version of dealing with this). I.e. you only know that the observed value lies in some interval (e.g. 2-3 drinks a day). You then assume that drinks follow some distribution (e.g. negative binomial, if they were discrete [which they are not] or zero-inflated log-normal) and specify a likelihood based on censoring (i.e. the likelihood is obtained as $$P(\text{observation falls into } [y_\min, y_\max])$$, where $$y_\min, y_\max$$ is the reported category).

You have the option of defining your own loss function (more machine learning type of phrasing the solution): I.e. you can some model (e.g. a neural network) to predict a continuous number of drinks, but score them according to whether they fall into the correct bin (the only thing you know).

These two approaches are the same thing, just a different way of phrasing it.

The question is not clear to me.

Are you asking should we bin data or use the contentious number? If that is your question, please check this post

What is the benefit of breaking up a continuous predictor variable?

If the data is already binned and we have to use the binned data. We still can use the regression with categorical independent variables (or mix of continuous and discrete variables).

This link has some examples on how to "code" categorical independent variable. And this link has examples to use a mixture of continuous and discrete independent variables.

• The number of drinks per month is continuous, every other variable is already binned. – Brian Jul 26 '17 at 14:00
• The variable is not categorical - it is ordinal. – mkt - Reinstate Monica Jul 26 '17 at 14:06
• @mkt many people use "categorical" to describe discrete variables which can include ordinal. – Haitao Du Jul 26 '17 at 14:09
• If I call a hamster a dog, should I treat it as if it were a dog? Misuse of terminology should be corrected. stats.idre.ucla.edu/other/mult-pkg/whatstat/… – Jon Jul 30 '17 at 2:41

The outcome variable that you want to predict here, number of drinks consumed per month, is a count variable. The fact that many potential predictors are binned is inconsequential; it is the distribution of the outcome that matters for determining what kind of regression modeling is needed. Here, since the outcome is a count, you can consider regression methods that are appropriate for count variables, such as Poisson and negative binomial regression.

In my experience, Poisson regression is not a good choice because real count data like these are almost always over-dispersed, meaning that they exhibit more variation than can be accounted for by a Poisson model. So you might start with Poisson regression but move to negative binomial after. The model fits can be compared via likelihood ratio test for nested models or with fit indices such as AIC and BIC.

When considering counts of events that are rather rare you may have an overabundance of zeroes. This might happen if with past 30 day alcohol but would be more likely with something like past 30 day steroid use (or some other, more rare drug). In those cases, zero-inflated or hurdle models can be useful, especially if you have other covariates in the model.

Here is a good resource.