面板数据进行sobel检验 先参考的陈强老师给出的代码:
sgmediation xfdf,mv(cyjg) iv(szdf) cv(lngdp czh llh rlzy zfgy)
这个代码跑出来,系数c a b啥的都是显著的没有问题,具体如下:
Coef Std Err Z P>|Z|
Sobel .07342646 .02424316 3.029 .00245568
Goodman-1 (Aroian) .07342646 .02448251 2.999 .00270744
Goodman-2 .07342646 .02400142 3.059 .00221889
Coef Std Err Z P>|Z|
a coefficient = 3.69562 .59688 6.19157 6.0e-10
b coefficient = .019869 .005722 3.47259 .000515
Indirect effect = .073426 .024243 3.02875 .002456
Direct effect = .14898 .059282 2.51307 .011968
Total effect = .222407 .056535 3.93394 .000084
Proportion of total effect that is mediated: .33014507
Ratio of indirect to direct effect: .49286055
Ratio of total to direct effect: 1.4928605
但是考虑是面板数据,因此想要固定时间和地区,所以有了下面的代码,
xi:sgmediation xfdf,mv(cyjg) iv(szdf) cv(lngdp czh llh rlzy zfgy i.year i.id)
知乎上看到的,俺试了试双固定,能够跑出来,但是跑出来的系数c a 都不显著:
Coef Std Err Z P>|Z|
Sobel -.00826246 .03344536 -.247 .80487464
Goodman-1 (Aroian) -.00826246 .03396672 -.2433 .80781059
Goodman-2 -.00826246 .03291574 -.251 .80179991
Coef Std Err Z P>|Z|
a coefficient = -.084342 .341078 -.247281 .804691
b coefficient = .097964 .017381 5.63611 1.7e-08
Indirect effect = -.008262 .033445 -.247043 .804875
Direct effect = .046734 .089136 .524302 .600069
Total effect = .038472 .094996 .404979 .685493
Proportion of total effect that is mediated: -.21476795
Ratio of indirect to direct effect: -.17679751
Ratio of total to direct effect: .82320249
然后我开始即兴创作,试了试只固定时间(因为我的基准回归就是固定时间效应,所以这里也试了试)
xi:sgmediation xfdf,mv(cyjg) iv(szdf) cv(lngdp czh llh rlzy zfgy i.year)
结果显著,
Coef Std Err Z P>|Z|
Sobel .07721265 .02382039 3.241 .00118923
Goodman-1 (Aroian) .07721265 .02403505 3.213 .00131584
Goodman-2 .07721265 .02360378 3.271 .00107093
Coef Std Err Z P>|Z|
a coefficient = 4.02758 .628064 6.41269 1.4e-10
b coefficient = .019171 .005103 3.75672 .000172
Indirect effect = .077213 .02382 3.24145 .001189
Direct effect = .173055 .055154 3.13769 .001703
Total effect = .250268 .052481 4.76877 1.9e-06
Proportion of total effect that is mediated: .30851982
Ratio of indirect to direct effect: .44617305
Ratio of total to direct effect: 1.4461731
所以想知道这种能不能用,单固定时间效果还挺不错的,


雷达卡






京公网安备 11010802022788号







