# How to deal with binary predictors in a logistic regression model?

I'm building a logistic regression model in R using glm(y ~ x1 + x2 + x3 + x4, data = train.set, family = binomial(link = 'logit')). Among 4 predictors x1, x2, x3, x4, they all are categorical. However x1, x2, x3 are on a scale of 0 to 10, and x4 is binary (0 or 1).

My question is how should i properly pre-process x4? I'm asking because I know it is a really important variables in terms of prediction, but it's showing a pretty low importance in the summary() due to the fact that it's on a different scale as the rest of predictors.

Could someone who has experienced similar situation share your approach? Thanks a lot!

edit: all predictors x1, x2, x3, x4 are factors. I do understand that as long as they are all factors, it shouldn't matter what values each predictors they have. but we expect x4 to be a more important predictors, but varImp shows the opposite.

• Could you provide a reproducible example ? Also, is x4 (as well as the other predictors) a factor variable ? – nghauran Jun 26 '19 at 13:47
• Your regression will set up dummy variables for the RHS categorical variables. This might help: r-bloggers.com/regression-on-categorical-variables – bjorn2bewild Jun 26 '19 at 13:47
• Just make sure you set your categorical variables as factors. – James Jun 26 '19 at 13:51
• How many observations do you have? It's possible you do not have enough for the amount of combinations three 10 level factors and one 2 level factor has. – spazznolo Jun 26 '19 at 13:52

• Hi Jenks, thanks for your response! I do have all variables as factors. but we just expect x4 with higher importance. – S.J Jun 26 '19 at 14:04