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.

  • 1
    $\begingroup$ 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! $\endgroup$
    – jcken
    Commented Aug 19, 2020 at 20:03
  • $\begingroup$ binning is fine, forget statisticians $\endgroup$
    – Aksakal
    Commented Aug 19, 2020 at 21:49
  • $\begingroup$ Note that @Aksakal means that as a joke. $\endgroup$
    – Dave
    Commented Aug 19, 2020 at 21:50

1 Answer 1


Binning a continuous variable is not a good idea. You're unlikely to be physically assaulted by statisticians for doing that, but you would probably get a lot of hard stares and frowns and muttering under the breath.

There's a much better approach to deal with this type of problem, which would turn the frowns into smiles: use a mixed model. That allows you to combine information usefully among individuals in different regions without having to cover all combinations of predictors within each region. Depending on the purpose of your study that could be done with a multi-level model that treats both individuals and regions as random effects. This recent answer provides a nice description of the advantages of such modeling.

With respect to age as a continuous predictor, you might find it useful to model with a spline that can discover nonlinear relationships between age and outcome as part of a linear modeling process. That can be incorporated within a mixed model via standard software packages.

  • $\begingroup$ Thank you so much! I am actually running a multilevel model: y ~ age + ... + (1 | region). Median age slightly differs between regions. Where should I place "age" variable to adjust this between the regions? Adding this as a free slope - (age | region) - would not adjust subject's ages between regions? $\endgroup$
    – st4co4
    Commented Aug 20, 2020 at 6:55
  • $\begingroup$ @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. $\endgroup$
    – EdM
    Commented Aug 20, 2020 at 12:53
  • $\begingroup$ Thank you so much! This multilevel model still overestimates y-values, thus I used splines to overcome the problem: y ~ s(age) + ... + (1 | region). Splines model was slightly better and gave believable conditional y values. $\endgroup$
    – st4co4
    Commented Aug 20, 2020 at 13:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.