连老师专栏里提供的组间系数差异检验方法,我尝试了三种,但是结果差异也太大了吧,不知道该用哪个了。。。。。
专栏地址:https://zhuanlan.zhihu.com/p/28502370
三种方法stata指令
***第一种
**组内去心
webuse "nlswork",clear
xtset idcode year
*对核心变量执行组内去心:去除个体效应
local y "ln_wage"
local x "hours tenure ttl_exp south"
bysort id: center `y',prefix(cy_) //组内去心
bysort id: center `x',prefix(cx_)
*-分组回归分析
reg cy_* cx_* i.year if collgrad==0 // 非大学组
est store Yes
reg cy_* cx_* i.year if collgrad==1 // 大学组
est store No
*-列示分组估计结果
esttab Yes No, nogap mtitle(Yes_Coll No_Coll) ///
star(* 0.1 ** 0.05 *** 0.01) s(r2 N)
*-似无相关估计
suest Yes No
*-组间差异检验
test [Yes_mean]cx_ttl_exp = [No_mean]cx_ttl_exp
test [Yes_mean]cx_hours = [No_mean]cx_hours
***第二种
tab year,gen(a)
bdiff,group(collgrad) model(xtreg ln_wage hours tenure ttl_exp south a1-a15,fe) reps(500) bs first detail
***第三种
bdiff,group(collgrad) model(reg ln_wage hours tenure ttl_exp south a1-a15) surtest
图片依次是三种方法结果