Interaction term with categorical variables with more than 2 levels


New Member

I am running a regression. I work on SAS (using GLM in the discussed below).

My outcome is continuous (Y). I have two nominal independent variables (variable A - 3 categories and variable B - 3 categories (categorized from an initial continuous variable)) with which I want to create an interaction term (A*B).

My main concern is about how to model A and B in my interaction term. In fact, I could:


A in the model as dummy variables,
B in the model as dummy variables,


1. A*B with A and B specified as dummies
2. A*B with A and B as categorical but not coded as dummies
3. A*B with A as dummy and B as continuous (initial non categorized B variable)


I am puzzled as I have never worked on interaction with more than 2 levels before. Also, I have read in some articles doing analyses close to mine that the interaction term was modeled on continuous variables.

Can anyone help me in understanding the difference between the scenarios above? When why and how to model the variables in the interaction term?

Thanks a lot!


Not a robit
Hmm, here is something a did awhile back. It was logistic with a continuous*cat(3 group) interaction. I bet you could construct something similar. I prefer to visualize interactions. So you would have y-hat on y-axis then 3 categories on the x-axis and data stratified into three groups (lines).

I believe that may be equivalent to just entering them into the model via the CLASS statement. Ideally you would also want to put whiskers on the estimates. Without the model in front of me, I am unsure if you have to deal with setting reference groups. if so, they may be selected via lowest values our perhaps could be reported by using the intercept values.