Logistic regression: if only some classes of a categorical variable appear significant I am performing (rare events) logistic regression analyses in R and want to test several categorical variables consisting of more than two classes. I understood that I can do this by using factor(). However, I am not sure what to do in case some, but not all categories are significant. Can I (1) just leave out the ones that are not significant, assuming their coefficients equal 0, or (2) do I have to include them all in the model, or (3) do I somehow have to recalibrate the logistic regression model with only the significant dummies?
Thanks in advance!
 A: The contrasts you mention are a function of the choice of reference cell, so are arbitrary.  Removing dummy variables (combining categories) will ruin type I error, confidence interval coverage, and bias estimates.  There is nothing wrong with having 'insignificant' effects in a model.
A: That depends on what you mean by leaving out factors that aren't significant, and how your logistic regression is coded. If one level of your factor is being treated as the reference group (it always has effect estimate = 0), and other levels of that factor are coded as dummy variables (1 for subjects in that level, 0 otherwise), removing the dummy variables for some other levels is equivalent to combining those levels with the reference group. In R, the default reference group is the value that comes first in alphabetical order, so think about whether that makes sense. This is exactly the same thing as recoding your categorical variable. However, if you're comparing several different codings (or, parametrizations) to see which one fits best, you need to account for this when reporting your results, because the probability of observing "significant" results by chance increases with the number of different models you try.
