# On the inclusion of intercept when performing regression with categorical and continuous predictors

Following this great QA here, I have some basic questions on performing hypothesis test for categorical predictors while controlling for the effect of other predictors (continuous):

Suppose I have a categorical predictor C with 3 levels C1, C2, and C3, and a continuous predictor called Z that I want to control for while performing a one-sided Wald test on the coefficients of the dummy variables of C (C1, C2, and C3).

As @COOLSerdash suggested one can exclude the intercept to avoid having coefficients denoting the difference to the base:

my.mod <- glm(y ~ Z + C - 1, data = data, family = "binomial")

summary(my.mod) # no intercept model

Coefficients:
Estimate Std. Error z value Pr(>|z|)
Z     0.002264   0.001094   2.070 0.038465 *
C1   -3.989979   1.139951  -3.500 0.000465 ***
C2   -4.665422   1.109370  -4.205 2.61e-05 ***
C3   -5.330183   1.149538  -4.637 3.54e-06 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

• Does the exclusion of intercept affect Z? In other words, in these scenarios, what's the point of having intercept, when one is not interested in comparing the effect of levels of C compared to base C1?
• Does the same approach apply to linear regression?
• And to my understanding, here I'm performing three one-sided Wald tests (using z scores) which needs correction for multiple tests, to make sure alpha is still 0.05, is that right?

## 1 Answer

The exclusion of the intercept does not affect the interpretation of the coefficient on Z. If you try running the model with an intercept, you will find Z has the same coefficient. Note that this will not hold when you include interactions between Z and the dummy variables.

The same approach does indeed apply to linear regression. Nothing is special about generalized linear modeling regarding this issue. You are changing the meaning of the coefficients for the dummy variables, but the model structure is otherwise the same.

It would be best practice to perform a correction for multiple corrections, but this is often not done in the regression context. You could pick a new alpha based on the correction (e.g., with a Bonferroni correction, your new alpha would be .05/3), and then find the critical Z-score for your one-sided test.