How to test the statistical significance of the difference of two univariate Linear Regression betas?

Hi all,

There are two samples of data: D1 and D2.

On data D1 we do a univariate Linear Regression and get the coefficient beta1.

On data D2 we do a univariate Linear Regression and get the coefficient beta2.

How do I test the statistical significance of (beta1-beta2)?

Could you please recommend packages/commands in R for doing this?

Thanks a lot!

**Contents**hide

#### Best Answer

If the two samples are not overlapping and if the two $beta$'s you want to compare are related to the same variable (for example you want to see if the relationship between weight and height using linear regression is the same among men and women), you could pool the data and include an interaction term (between gender and your independent variable) in your model and test it against the null $H_0: beta_{interaction} = 0$.

Otherwise, you could consider using Seemingly Unrelated Estimation. See for example the `suest`

postestimation command in Stata (unfortunately I'm not an R user).

### Similar Posts:

- Solved – Testing for statistical differences of quantile regression line slopes
- Solved – Mean centering interaction terms
- Solved – Mean centering interaction terms
- Solved – Why do we not interpret main effects if interaction terms are significant in ANOVA
- Solved – Why do we not interpret main effects if interaction terms are significant in ANOVA