Hi, is there any way to compare the coefficients of interaction term across different subgroups using reghdfe?
Suppose I'm interested in the effects of union in the city on wage (ln_wage), which makes me interact "union" with "city" variable. In addition, I'd like to do subgroup analysis by marriage (msp) and test whether the coefficients of interaction term (union#c_city) in two groups, which are -0.0196 and -0.0298 in the example code below, are significantly different to each other. How can I compare these two interaction coefficients?
Suppose I'm interested in the effects of union in the city on wage (ln_wage), which makes me interact "union" with "city" variable. In addition, I'd like to do subgroup analysis by marriage (msp) and test whether the coefficients of interaction term (union#c_city) in two groups, which are -0.0196 and -0.0298 in the example code below, are significantly different to each other. How can I compare these two interaction coefficients?
Code:
webuse nlswork, clear reghdfe ln_wage union##c_city if msp==1, absorb(idcode year) ------------------------------------------------------------------------------ ln_wage | Coefficient Std. err. t P>|t| [95% conf. interval] -------------+---------------------------------------------------------------- 1.union | .1045442 .011149 9.38 0.000 .0826896 .1263987 1.c_city | .0331573 .0132385 2.50 0.012 .0072068 .0591078 | union#c_city | 1 1 | -.0196805 .0190602 -1.03 0.302 -.0570431 .017682 | _cons | 1.72928 .0048373 357.49 0.000 1.719798 1.738763 ------------------------------------------------------------------------------ reghdfe ln_wage union##c_city if msp==0, absorb(idcode year) ------------------------------------------------------------------------------ ln_wage | Coefficient Std. err. t P>|t| [95% conf. interval] -------------+---------------------------------------------------------------- 1.union | .1249048 .015938 7.84 0.000 .0936593 .1561504 1.c_city | .0331801 .0160409 2.07 0.039 .0017327 .0646274 | union#c_city | 1 1 | -.0298477 .0213081 -1.40 0.161 -.071621 .0119256 | _cons | 1.72628 .0083392 207.01 0.000 1.709931 1.742628 ------------------------------------------------------------------------------
Comment