# Model selection for dependent variables

I think this is a silly question, but I would like to be sure of my interpretations.

Let's say I have a response variable Y and two explanatory categorical variables A and B. Each of them has 4 categories (but, I am also interested to know what happens with any number of categories).

I want to find which of the 2 variables explains more the variation of Y. A and B are not independent.

I have the following models:

M_0 : Y ~ 1
M_A : Y ~ A
M_B : Y ~ B
M_AB : Y ~ A+B


And then I calculate AIC for each. Are these interpretations right:

• AIC(A) < AIC(AB) < AIC(B) < M(0) --> A explains more of Y variation than B, so I can get rid out of B?;
• AIC(AB) < AIC(A) < AIC(B) < M(0) --> both A and B explain variations in Y, but A explains more than B?

I am not sure whether I should use AIC, or the p-values (but can I really compare the p-values and conclude which variable affects my response the most?)

Edit :

To make my point clearer, let's take an example. Let's say I want to explain people's height (Y). My initial explanatory variable is eye color (A : [black-blue-green-brown]). Then I consider hair color (B : [blond-black-red-brown]), which is not independant with eye color. I want to determine whether B explains height better than A, or whether I have to consider both.

• You may want to be careful about terminology. While there may be some dependency between A and B, typically we use "dependent variable" to refer to what's on the left hand side of the model (i.e. Y) and "independent variable(s)" to refer to what's on the right hand side (i.e. A, B, etc.). I certainly found the question a little confusing at first as a result of mixing up terms. – Ian_Fin Sep 22 '16 at 10:44
• If you say A and B are factors, does that mean they are R factors, i.e., categorical variables? If yes, your interpretation might not be correct (if both have different numbers of levels) since AIC penalizes the number of parameters. Furthermore, model selection is a slippery slope and tricky business. What do you intend to do with the final model? – Roland Sep 22 '16 at 10:52
• You may still be able to include an interaction even if there are some combinations of A and B which do not occur. It depends on the pattern. But @Roland is right, you need to say what your final model is going to do. – mdewey Sep 22 '16 at 11:08
• @Roland: Post edited according to your remarks. – Nausi Sep 22 '16 at 12:08