Suppose I have two independent variables, X1
and X2
. X1
is binary--coded as 1 or 0. X2
has three ordered but most likely not equidistant levels--let's call them "low," "medium," and "high." I want to know if there is a significant interaction between X1 and X2 in a regression I am running.
Classically, one would treat X2
as an ordinal variable. However, the interaction between X1
and X2
is not fully crossed--there are no observations for which X1
is equal to 0 and X2
is equal to "medium." This makes the coefficients matrix rank-deficient--one factor level combination is "missing." Moreover, when you include an ordinal variable as an independent variable in a model in R, it models these variables using linear and quadratic terms (which is logical), which introduces a level of complexity into my model I'm not comfortable with, if I can avoid it.
I see two alternative approaches:
- Removal all observations for which
X2
is equal to "medium" so that I no longer have to treatX2
as anything other than a binary factor. In that case, the interaction betweenX1
andX2
would become fully crossed. This throws away data though, so I'd rather not go this route. - Violate the "statistics rules" I had been taught and treat
X2
as continuous/numeric instead, coded as something like 0, 1, and 2 for "low," "medium," and "high," respectively. The model would run this way, but the coefficients would be a little messy to interpret, and so this would only be a qualitative assessment of significance (which would probably be good enough, actually, as long as it was unbiased).
I would opt for option 2, but I was wondering if this is the "right" way to proceed and, if not, what alternatives am I maybe not considering?
P.S. I have seen here that some fields treat ordinal variables as continuous routinely. However, as discussed in this thread, one must think carefully about what one is really after when considering this type of question. For me, I am guessing that there is either going to be a very significant interaction, or a very insignificant one. As such, a "messy" but "unbiased" approach would be sufficient, I think?
Edit: For a test model, I ran both approaches listed above and the beta coefficients and P values for the interaction term end up being very, very similar between the two models. My conclusion would be the same in each case (the interaction is significant at alpha = 0.05). Does this potentially strengthen my justification for choosing option 2?