Correlation of beta coefficients from linear regression [duplicate]

Suppose that I have a linear regression: $$y = \beta_{0} + \beta_{1}x_{1} + \beta_{2}x_{2} + \epsilon$$

I would like to demonstrate that one regression coefficients is significantly greater than the other:
$$H_{0} = \beta_{1} > \beta_{2}$$ or $$H_{0} = \beta_{1} - \beta_{2} > 0$$.

Therefore, I would conduct a t-test:

$$t = \mu_{d} / \sigma_{d}$$
with $$\mu_{d} = \beta_{1} - \beta_{2}$$ and $$\sigma_{d} = \sqrt{\sigma_{\beta_{1}}^2 + \sigma_{\beta_{2}}^2 - Cov(\beta_{1}, \beta_{2})}$$

and $$Cov (\beta_{1}, \beta_{2}) = \sigma_{\beta_{1}} * \sigma_{\beta_{2}} * \rho_{\beta_{1}, \beta_{2}}$$

As $$\beta_{1}$$, $$\beta_{2}$$, $$\sigma_{\beta_{1}}$$ and $$\sigma_{\beta_{2}}$$ are known from the regression results, the only mising part is the correlation of $$\beta_{1}$$ and $$\beta_{2}$$. However, I don't know how this can be computed and would be really thankful for any help!

• Hi: You can calculate the covariance matrix $\Sigma = \sigma^2 (X^{\prime}X)^{-1}$. The correlation is then the square root of the element in the second row and the third column. Jun 16 '20 at 9:23
• Thank you very much!
– Emil
Jun 18 '20 at 4:01
• no problem. glad to help. Jun 19 '20 at 2:22