Hello,

I am running a regression on two subsamples (s2=0 and s2=1). I would like to test whether the coefficients for X are statistically different. I have tried using suest, however it is not supported by gsem. My code:

Code:
svy: gsem (m <- i.x i.fatempLG i.mteducstLG, ologit) (y <-  i.m i.x i.fatempLG i.mteducstLG, mlogit) if s2==0
est store one
svy: gsem (m <- i.x i.fatempLG i.mteducstLG, ologit) (y <-  i.m i.x i.fatempLG i.mteducstLG, mlogit) if s2==1
est store two
gsem, coeflegend
The coefficients I would like to compare at the ones obtained for variable X (Y regressed on X, second regression in gsem). Below is an example of my dataset. Can anyone please help with this?

Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input float(m x fatempLG mteducstLG y s2)
. . . . . .
1 0 1 0 0 0
. . . . . .
0 0 1 1 0 1
. . . . . .
3 0 1 2 3 0
. . . . . .
2 0 1 0 0 0
. . . . . .
3 1 1 1 0 0
. . . . . .
0 0 1 0 0 1
. . . . . .
3 0 1 0 2 0
. . . . . .
2 0 1 1 0 0
. . . . . .
3 0 1 0 0 0
. . . . . .
3 0 1 0 0 1
. . . . . .
2 0 1 0 0 1
. . . . . .
3 0 1 0 0 0
. . . . . .
2 0 1 0 0 1
. . . . . .
2 0 1 0 0 1
. . . . . .
2 0 1 0 1 1
. . . . . .
2 0 1 0 0 1
. . . . . .
3 1 1 2 3 0
. . . . . .
2 0 1 0 0 1
. . . . . .
0 0 1 0 1 1
. . . . . .
2 0 1 0 0 1
. . . . . .
1 1 1 1 0 1
. . . . . .
3 1 1 2 0 0
. . . . . .
2 0 1 1 0 0
. . . . . .
0 0 1 0 0 1
. . . . . .
0 0 1 0 1 1
. . . . . .
3 1 1 2 2 0
. . . . . .
2 0 1 0 1 0
. . . . . .
0 1 1 1 0 1
. . . . . .
1 0 1 0 1 0
. . . . . .
1 0 1 0 0 1
. . . . . .
3 0 1 0 1 0
. . . . . .
2 0 1 1 0 1
. . . . . .
2 0 1 1 0 1
. . . . . .
3 0 1 0 3 1
. . . . . .
2 0 1 0 1 0
. . . . . .
2 0 1 0 0 1
. . . . . .
2 0 1 0 0 0
. . . . . .
2 0 1 0 0 0
. . . . . .
2 0 1 0 0 0
. . . . . .
2 0 1 0 0 1
. . . . . .
0 0 1 0 0 0
. . . . . .
3 0 1 0 0 1
. . . . . .
2 0 1 0 0 1
. . . . . .
2 0 1 0 0 1
. . . . . .
2 0 1 0 0 1
. . . . . .
2 1 1 2 0 0
. . . . . .
2 1 1 2 3 0
. . . . . .
3 0 1 1 3 0
. . . . . .
2 0 1 1 0 0
. . . . . .
2 0 1 0 0 1
end
label values m educ
label def educ 0 "Illiterate", modify
label def educ 1 "Less than vocational secondary", modify
label def educ 2 "Vocational secondary", modify
label def educ 3 "University & post-grad", modify
label values fatempLG femp
label def femp 1 "Employed", modify
label values mteducstLG meduc
label def meduc 0 "Illiterate", modify
label def meduc 1 "Less than vocational secondary", modify
label def meduc 2 "Vocational secondary", modify
label values y change2
label def change2 0 "Consistently unemployed", modify
label def change2 1 "Unemployed - employed", modify
label def change2 2 "Employed - unemployed", modify
label def change2 3 "Consistently employed", modify