# Improving Logistic Regression model's summary output

Logistic Regression using R's glm package is giving me the following summary (snap of the few first variables).

My Data Set:

• Dimensions: 1252 rows and 224 columns (after using model.matrix). The Data has been standardized.
• Response variable is binary.
• Trying to predict if an employee will leave the company, based on employee attributes

My Understanding:

The model does not give a good fit because:

1. Residual Deviance > Null Deviance.
2. p.value = 1 - pchisq(3676.5, 817) turns out to be 0.
3. The first warning about 0 or 1 fitted probability message suggests that due to some predictor(s) the model might be giving perfect predictions
4. Second warning on ‘rank deficiency’ suggests that there might be predictors that are linearly dependent on one another.

My Questions:

1. How can I improve the model? I would like to see Residual Deviance < Null Deviance. I will invest time on dropping the linearly dependent variables in the model, but is there anything I should do first to test the ‘model’ itself, before revisiting my data? I am asking this because SVM worked quite well on the same data set.
2. Why do I have such extreme coefficient values?
3. Many answers to other posts state that ‘AIC’ is used to compare different
4. The summary parameters (coefficients , std error and p-values) for many dummy factors obtained via model.matrix, like GSS_SEXM, is shown as 'NA'. Why is it so?
5. logistic models. What is meant by ‘different’ here? Models trained on different data sets that bear different coefficients, like say different set of attributes?
• My first thought, seeing the coefficient size, is that something very bad happened. Oh, that’s what the message in red is telling us... Look for example at GSS_SEXM: of course you can’t estimate the effect of this variable together with GSS_SEXF, as GSS_SEXF+GSS_SEXM = 0. I think this is the case for many of your variables, you can sum some of them to obtain another one. This is not a well defined model. – Elvis Feb 26 '16 at 21:04
• Thanks for your response. GSS_SEX was 1 column earlier, with 2 factors, "M" and "F" in it. I could not get 'glm' running without using 'model.matrix' which splits each of the factors into different columns. This is why I had to first split each such variable with multiple factors in it into separate columns. – batool Feb 26 '16 at 21:15
• Welcome to our site! I edited a few things to improve the formatting (see our editing help for more information). By the way, on this site there's no need to say "thank you" at the end of your post - it might seem rude at first, but it's part of the philosophy of this site (tour) to "Ask questions, get answers, no distractions" and it means future readers of your question don't need to read through the pleasantries. I wonder if you might be able to make your title more specific, somehow, but I don't have a good suggestion right now. – Silverfish Feb 26 '16 at 21:16
• I would guess that you have found perfect separation in your logistic regression, due to the large number of predictor variables for this number of cases. This is discussed extensively elsewhere on this site, for example here and here. Follow the hauck-donner-effect tag on this site. Please read such other posts and edit your question to focus on any aspects that aren't already covered. – EdM Feb 26 '16 at 21:38
• @EdM I was able to fix the collinearity effect, as indicated by the fitted probability warning by using VIF function of 'rms' package. It told me around 50 variables were causing collinearity. After removing them, the warning did go away, but so did some of the variables that intuitively seemed important. Length of service was one such variable. – batool Mar 3 '16 at 17:49