学生建了个模型,感觉有内生问题,于是用了2SLS。代码如下,请各位前辈多批评指正。
问题一:想向各位前辈请教,这么做逻辑和步骤对不对啊?
原模型:y x1 x2
方 法:2SLS
工具变量:L.X1(为X1滞后一期,X1的工具变量),L.X2(为X2滞后一期,X2的工具变量)
拟合值:X1_hat , X2_hat
第一阶段代码:
xtreg X1 L.X1,fe
predict X1_hat
xtreg X2 L.X2,fe
predict X2_hat
然后,用hausman检验
第二阶段代码:
xtreg y x1 x2,fe
est store fe
xtreg y x1_hat x2,fe
est store iv_fe
hausman iv_fe fe
(结果chi>0,P<0.01)
xtreg y x1 x2,fe
est store fe2
xtreg y x1 x2_hat ,fe
est store iv_fe2
hausman iv_fe2 fe2
(结果chi>0,P<0.01)
问题二:这个结果是不是说明两个变量都有内生性?
然后我尝试了两个拟合值同时代入,并跟第二阶段一个拟合值带入的模型 进行hausman检验。目的是想看看哪个模型更优。
第三阶段代码:
xtreg y x1 x2_hat ,fe
est store fe3
xtreg y x1_hat x2_hat ,fe
est store iv_fe3
hausman iv_fe3 fe3
(结果chi<0)
xtreg y x1_hat x2,fe
est store fe4
xtreg y x1_hat x2_hat ,fe
est store iv_fe4
hausman iv_fe4 fe4
(结果chi<0)
问题三:请问这个逐步加入拟合值的方法逻辑上对不对?
问题四:如果逻辑上是正确的,那么xtreg y x1 x2_hat ,fe和xtreg y x1_hat x2,fe这两个模型怎么选?再做一次hausman检验吗?


雷达卡





京公网安备 11010802022788号







