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

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!

• Are the response variables the same in both cases (eg, both weights)? Are the covariates the same (eg, both weights)? Is this two different groups (eg, college basketball & football players) or two different studies? The answers to these questions would help people answer. Also, I notice that you've asked 9 questions & not accepted a single answer yet. You may want to click the 'check' mark next to answers that you've found helpful in your previous questions; it's a nice thank you to people who've helped you, and encourages people to keep helping you. Mar 14, 2012 at 16:15

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).