So I run logistic regressions of same dependent variables and independent variables on two sets of data $S_1$ and $S_2$. I obtained two sets of coefficients $beta_1$ and $beta_2$. Now I suspect that $beta_1$ and $beta_2$ should really be equal, since I don't think there are distinctive difference between $S_1$ and $S_2$.

My question is, how do I test the significant differences between the coefficients?

Thanks!

**Contents**hide

#### Best Answer

You can stack the 2 datasets on top of each other with an indicator variable for which dataset the data comes from. Example (simplified):

`> d1 y x 1 0 1 2 0 2 3 1 3 > d2 y x 1 0 2 2 1 3 3 1 4 > d3 y x g 1 0 1 0 2 0 2 0 3 1 3 0 4 0 2 1 5 1 3 1 6 1 4 1 `

Then fit a model with interactions with the grouping variable, i.e.

`logit(y) ~ b0 + b1*x + b2*g + b3*x*g `

The test on b2 will measure the difference in the intercepts (compare to your seperate fits) and b3 will measure the difference in the slopes (compare again), so tests on b2 and b3 are the tests of interest. If you have additional covariates then just include them as well with the interaction terms.

### Similar Posts:

- Solved – Test the significant differences between the coefficients obtained by logistic regression on two data sets.
- Solved – Test the significant differences between the coefficients obtained by logistic regression on two data sets.
- Solved – Comparing logistic regressions
- Solved – Model for comparison of two subsets of the same data
- Solved – How to compare results from two regressions