# Regression: is it wrong to bin a continuous variable to overcome overfitting?

Would statisticians hang me for doing the following?

I have a heterogeneous dataset of elderly subjects. Thus, I have model with 7 predictors, including 4 categorical ones, of which some have many levels. I am doing a regional analysis, which means that some regions have fewer subjects on certain reference levels of different categorical variables.

Subjects are mostly aged 70-90 years. Age variable, ranging from 50-100, is causing clear overfitting while comparing it to the plots explanatory data analysis. I found out that there are not enough subjects at mean age at some regions to make meaningful predictions. When I bin the age variable into 10-year bins and use the bin with the largest number of subjects as a reference, the results of the regression are in line with the explanatory data analysis.

Would the binning of age variable will be okay if I publish both: plots on raw data + adjusted analysis? Thus, both analysis confirm the main outcome - regional variablity.

• Could you add some plots of the "overfit" and some scatter plot of your variables? I feel like in binning the data you're losing (potentially important) information. The results could also be sensitive to the number and width of bins! – jcken Aug 19 at 20:03
• binning is fine, forget statisticians – Aksakal Aug 19 at 21:49
• Note that @Aksakal means that as a joke. – Dave Aug 19 at 21:50

• @st4co4 it doesn't matter that median age differs among regions. An age fixed effect could handle that directly. A (1|region) term represents random intercepts. If you centered the age variable about its median and used age as a fixed effect, the random intercepts would be for a (hypothetical) situation in which all subjects had the median age, thus correcting for differences in median age among regions. An (age|region) random slope is only needed if you are looking for associations of age with outcome that differ among regions. – EdM Aug 20 at 12:53