# Interpreting coefficients in Linear regression with categorical variables and one hot encoding (drop first)

I am doing multiple linear regression where my independent variables are a mix of categorical and numerical variables. Obviously I need to one-hot-encode the categorical variables, and I need to "drop-first" to prevent collinearity (since I want to interpret my coefficients).

Assume a one-hot-encoded categorical variable $$X$$ with $$n$$ categories. When I drop the first variable $$X_1$$, obviously my coefficients will correspond to $$X_{2..n}.$$ i.e. I will have a linear model $$y = c_0 + c_1X_2 + c_2X_3 + ...$$ What does this mean? How do I get information about how $$X_1$$ affects the model? Can I extract it from the other coefficients or do I need to construct another model and drop another value e.g. $$X_2$$? Is it the case that the coefficients change meaning i.e. $$c_1$$ describes how $$X_2$$ affects the model in relation to $$X_1$$? If so, what is the best way to get the coefficients for all parameters $$X_{1..n}$$ so that $$c_i$$ describes how $$X_i$$ affects the model? Can I use regularization?

• The question isn`t very clear, but you seem to use drop-one to drop one (or more) of the dummys that as a group represent a categorical variable. That should never be done, see for instance stats.stackexchange.com/questions/182121/… Commented Nov 14, 2023 at 4:46