I am using
glm (target, formula = target~.,family=binomial) to predict binary outcome.
I have 9 grouped predictors. I convert them into factors so that I can test them in the regression as dummies.
Additionally, I have initially set the reference group
relevel=var_name(var_name, ref = "ref_group_name")
I run the regression and the result is decent at first glance (good Gini, just a few dummies with high significance).
What I would like to do further is as follows:
1) check Mallows' Cp ( one thing to be checked for overfitting of the model that I know is that Mallows' Cp should be close to the number of dummies entering the model)
2) interactively add/remove dummies in the model
3) check correlation between dummies rather than between the whole variables
For the first question I am not sure how to test Mallows' Cp (summary of the
glm result does not show it)?
For the second question I found package called
dummies(dummy.data.frame function) that can easily convert factor variables into dummies so that I can interactively add or remove them (I found that potentially I can do that with package
What I am missing is when I create the dummies data frame with
dummy.data.frame how can I select which is the
reference group when I put the resulting data.frame into the glm function?
For the third question: does it now make sense to run Pearson/Spearman correlation on the dummies data.frame (note: initially variables are both numeric and categorical before they were grouped)