# Evaluating a factor variable

I am seeking feedback on the theoretical appropriateness of two approaches I am planning to follow.

I have a dependent continuous variable (y) and several independent variables some of which are factors and some are continuous. One of the factors (fx1) has four levels "A", "B", "C" and "D" which may or may not be ordered. I want to test whether there is really any difference between "C" and "D" in predicting y after controlling for all other variables.

For this is it conceptually correct to follow the process below

1. Isolate instances where fx1 = "C" or "D"
2. Run a simple regression
3. Evaluate whether the coefficient for fx1 is significant

or is the following a better approach

1. Run the simple regression on the entire data
2. Run the simple regression again after collapsing "C" and "D" into one level
3. Compare the two models using ANOVA or AIC etc.

Is there any other approach that is more appropriate?

Thank you.

You can include indicators for both the pooled group CD as well as D alone in the regression; then the coefficient for D is the average difference between CD and D, and you'll get standard output (SE, t-stat, p value, etc) for the hypothesis test. Those test statistics should match up with the one-df ANOVA you proposed (F=t^2) but are a bit more directly interpretable.