# Logistic Regression in R with multi level categorical variable

After using weight of evidence & Information value mechanism, of the 40 odd variables I am left with 8 variables which are highly or moderately significant.
One of the independent variable which is categorical has 60+ categories. This is a very highly predictable variable hence please suggest as to how should I
use this variable in the model.
When I add this variable in the model my null deviance and AIC decreases and makes other predictors loose their predictive power.
Then another model without this variable my null deviance and AIC improves.
What could be the reason. Is this variable collinear with some other predictor.

Please see the syntax: < Without that Categorical Var>

m1.logit<- glm(survey ~ region+ know + repS+ und+ case_status, family = binomial(logit), data = a1 )
m1.logit
summary(m1.logit)

Call:
glm(formula = survey ~ region + know + repS + und + case_status,
family = binomial(logit), data = a1)

Deviance Residuals:
 Min       1Q   Median    3Q     Max
-2.579    0.271   0.290   0.336   2.895

Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for binomial family taken to be 1)
Null deviance: 2553.5  on 2540  degrees of freedom
Residual deviance: 1287.7  on 2526  degrees of freedom
AIC: 1318
Number of Fisher Scoring iterations: 13


Also ran an anova test to analyze the table of deviance

anova(m1.logit, test="Chisq")
Analysis of Deviance Table

Response: survey

Terms added sequentially (first to last)

Df Deviance Resid. Df Resid. Dev             Pr(>Chi)
NULL                         2540       2554
region       5       13      2535       2540                0.022 *
know         1      507      2534       2033 < 0.0000000000000002 ***
repS         1      715      2533       1319 < 0.0000000000000002 ***
und          1        3      2532       1316                0.109
case_status  6       28      2526       1288             0.000078 ***

Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1


Please suggest as to how to deal with this predictor variable with 50+ categories

• Can you please help with what variable it is? how are you using it currently in data: using woe? – muni Aug 23 '16 at 12:44
• @muni the variable I have is type of support provided to the application for instance - Code development, Single Sign on, API so on and so forth. While creating bins the count of survey received in these categories range from 1 to 1300 cases where 1300 and one another value is an extreme outlier but is very relevant as a large % of the surveys are received in these categories. Hope this helps. – Shivi Bhatia Aug 24 '16 at 8:51