# Testing equality of coefficients from two different samples

I have the regression statistics for the same regression run on two different samples, and am asked to explain whether it is possible to test for equality of the coefficents, $$\beta_1$$and $$\beta_2$$ between the two samples.

$$y_1 = X_1\beta_1 + \epsilon_1$$

My instinct is to treat it as if they came from the same regression, and do a t-test as follows:

$$\frac{\beta_{1}-\beta_{2}}{sd(\beta_{11}-\beta_{21})}$$

Would there be any issue doing it this way?

• Your notation is confusing, because it suggests there are two different models used for the same set of samples. What do the double subscripts in the denominator mean? Which should we believe: the notation or the words?
– whuber
Commented May 9, 2022 at 21:00
• My notation is likely wrong. It is the same model for 2 sets of samples. I want to test whether the regression coefficients for the 2 samples are the same Commented May 9, 2022 at 21:22
• Then, assuming the responses in one sample are independent of those in the other, you have observed two independent random variables and you have estimates of their sample variance: that leads to your t-test formulation, at least upon making standard assumptions (such as approximate Normality of the errors).
– whuber
Commented May 9, 2022 at 21:34
• Okay thanks. I guess this is the issue. If the explanatory variable represents returns to education, and the samples are two different groups of people (e.g. lawyers and investment bankers for instance), would you say they are likely not independent, as both their coefficients are probably correlated with quality of schools (i.e. if schools in general are better, both their returns to education coefficients would go up together) or am I misinterpreting this? Commented May 9, 2022 at 21:41
• You might be overcomplicating it. What matters are the responses conditional on the explanatory variables. Correlations among explanatory variables are not relevant in a regression model.
– whuber
Commented May 10, 2022 at 13:34