# How should I handle categorical variables with multiple levels when doing backward elimination?

I'm doing a simple AIC-based backward elimination model where some variables are categorical variables with multiple levels. These variables are modeled as a set of dummy variables. When doing backward elimination, should I be removing all the levels of a variable together? Or should I treat each dummy variable separately? And why?

As a related question, step in R handles each dummy variable separately when doing backward elimination. If I wanted to remove an entire categorical variable at once, can I do that using step? Or are there alternatives to step which can handle this?

-
I think it is hard to answer this question in a general context. If possible, can you pls provide some insights about what is your data? what do you want to infer? possible assumptions, etc. Providing these details might help us in answering your questions better. – suncoolsu Jan 7 '11 at 1:02
@suncoolsu I'm not really at liberty to discuss any of that. If it's possible to answer the question with a decision tree ('if you're assuming X, then do Y'), that could be really helpful. – nerdbound Jan 7 '11 at 2:11
For clarity, are you interested in interpreting the model as causal or are you simply interested in prediction? – Andy W Jan 7 '11 at 2:18

I think you'd have to remove the entire categorical variable. Imagine a logistic regression in which you're trying to predict if a person has a disease or not. Country of birth might have a major impact on that, so you include it in your model. If the specific USAmerican origin didn't have any impact on AIC and you dropped it, how would you calculate $\hat{y}$ for an American? R uses reference contrasts for factors by default, so I think they'd just be calculated at the reference level (say, Botswana), if at all. That's probably not going to end well...