2

Suppose I have a categorical variable neighborhood, which can take the classes Neighborhood1, Neighborhood2, Neighborhood3.

I would like to know which neighborhoods can be grouped and what neighborhoods differ in their effect from the rest, and then merge the ones with similar effects into one class.

I thought about running a logistic regression model and group all the classes with no statistical significance into one. (A note here, I would run the model with no intercept, because the baseline class method wouldn't be appropriate)

Do you think that is viable? Any other suggestion on how to proceed?

Franco Piccolo
  • 309
  • 2
  • 13

1 Answers1

1

I think that there are different ways of regrouping the sub-classes of a categorical predictors:

  1. If all the sub-classes are significant: then you can take a look at the estimated coefficient and regroup those who have more or less the same level of estimated coefficient. The reason is that they have the same effect on the outcome.
  2. If the sub-classes are non-significant, the first thing to do is to verify if your categorical predictor is significant or not, by performing one model with this predictor, and one without, then do a likelihood ratio test. If your predictor is non-significant, exclude it from your model. If not, try to regroup your predictor in a meaningful way: for example: if Neighborhood is a significant predictor, there is likely an underlying factor, such as the income, try to regroup your predictor base on that.
Metariat
  • 2,376
  • 4
  • 21
  • 41
  • 1. is especially dangerous - see [Algorithms for automatic model selection](http://stats.stackexchange.com/q/20836/17230). @StephenKolassa's answer in the post I linked as a duplicate of this is IMO accurate, but I'd take a more pessimistic view of the chances of improving predictive performance. If there's an issue with a model's overfitting, shrinkage of the coefficients is an alternative solution[How to handle categorical predictors with too many levels?](http://stats.stackexchange.com/q/67938/17230). – Scortchi - Reinstate Monica Jun 05 '15 at 10:43