1
$\begingroup$

I have an equation like y ~ x1 + x2 + x3 + x4 where the first 3 variables are categorical and the last one is continues. I want to identify the coefficients for all levels of these categorical variables. As you know, fitting OLS, I get one level for each variable as the base and the coefficients for the other levels are deviations from that base. I tried fitting 3 different specifications where I drop the intercept and estimate a coefficient for all of the levels in one of the categorical variables. I was hoping to use the results to solve the system of equations implied by those fits but it failed. Any suggestions for this problem?

$\endgroup$

2 Answers 2

1
$\begingroup$

The left-out level has an implied coefficient of 0, with an implied standard deviation of 0. How can I compute the standard error and confidence intervals for the base level on a variable? is a similar question with more details. Also Interpreting coefficient in GLM with categorical explanatory variables

$\endgroup$
0
$\begingroup$

You say "I want to identify the coefficients for all levels of these categorical variables", but actually you already did! As you probably know (or have read in the links Kjetil b halvorsen mentioned) the coefficients of the non-base categories show the differences with the base category. So, if a categorical has 4 levels, only three "differences" from the base category are shown. However, at the same time these three differences give you the differences from the base to the three other categories! So, what would you like to know more about the base category then? Actually, more information is shown about the base category than about the other (non-base) categories, for which only the difference with the base is shown!

With the default dummy variable, coded as 0 or 1, differences with the base are shown, or: the non-base categories are "contrasted" with the base category. Another interesting possibility is to show (for each category of X) the difference from the average outcome in your sample. In that case, the sample mean or average of your dependent variable serves as the reference point, instead of one particular category!

Example, suppose you have only two categories, 6 males and 4 females. The males have mean Y (dependent) value 10 and the females have mean 15. The total sample average would then be 12. For males, the regression effect would then be -2 as their mean lies 2 points below average, and for females the regression effect would be +3, as their means is 3 points higher than average. The intercept of the regression equation would be the sample average! This way of contrasting categories with the sample mean is another way of studying/describing influences of the different categories on the outcome variable. It is e.g. applied in package "wec" (weighted effect coding) in R. Also described here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.