# How to test if multiple regression coefficients are not statistically different?

Say I estimate the following multivariate linear regression $$y = \beta_0 +\beta_1 x_1 +\beta_2 x_2+\beta_3x_3+\beta_4x_4 + \epsilon$$ How can I test that $\beta_1=\beta_2=\beta_3$?

I know that to test if $\beta_1=\beta_2$ you can simply construct a $Z$ test with $$Z = \frac{\beta_1-\beta_2}{\sqrt{se_{\beta_1}^2+se_{\beta_2}^2}}$$

Is there an analogue for multiple coefficient estimates?

• The test for equality of $\beta_1$ and $\beta_2$ implicitly assumes the estimates of the $\beta_i$ are uncorrelated. In general it will be incorrect; the denominator needs to include a term for their covariance. – whuber Nov 16 '17 at 15:32
• If your X variables are in different units, then the beta coefficients are also in different units. In that case, I don’t see how it would make sense to compare them. – Harvey Motulsky Nov 21 '17 at 19:17

You can use the $F$ test to test any linear restrictions $L$ on your coefficients.

Let your null hypothesis be $H_0:L\beta = c$ and your design matrix $X$ with rank $k$. Then the $F$ statistic will be:

$$F = \frac{(L\hat{\beta}- c)'(\hat{\sigma}^2L(X'X)^{-1}L')^{-1}(L\hat{\beta} - c)}{q}$$

where $q$ is the number of restrictions you are testing. Under the null this will have an $F$ distribution with degrees of freedom $q$ and $n-k$.

In R you can easily do that with the function linearHypothesis of the car package. For example:

library(car)
lm.model <- lm(mtcars)
linearHypothesis(lm.model, c("cyl = 0", "disp = 0", "hp = 0")) # all 3 zero
linearHypothesis(lm.model, c("cyl = disp", "disp = hp")) # all 3 equal