Should you exclude one level of a categorical variable when it's part of an interaction term? I know that in linear and logistic regression, if we have a categorical variable (X1) with 3 levels (a, b, c) and we create 3 dummies, there are two ways to model.

*

*Drop the constant and include all 3 dummies

*Keep the constant and only include 2 dummies

My question is, if you want to build a model where (X2) is a quantitative variable:
Y = X1 + X2 + X1*X2
If we would like to include the constant, would we want to have have two X1 * X2 terms or three X1 * X2 terms?  That is would our final model be:
Y = C + X1a + X1b + X2 + X1a * X2 + X1b * X2
Or
Y = C + X1a + X1b + X2 + X1a * X2 + X1b * X2 + X1c * X2

So long as the base terms are already included in the model, you would drop one category from the categorical variable in the interaction.  For example, for a model using two categorical variables, using an intercept term plus a categorical term for all possible interactions is equivalent to using an intercept term, base terms for the two categorical variables, and an interaction dropping one category of each.  This equivalence is reflected in the arithmetic decomposition:
$$n^2 = 1 + (n^2-1) = 1 + (n-1) + (n-1) + (n-1)^2.$$
