全部版块 我的主页
论坛 休闲区 十二区 灌水吧
705 0
2022-08-28
HDFE Linear regression                            Number of obs   =        600
Absorbing 2 HDFE groups                           F(   8,     29) =       6.41
Statistics robust to heteroskedasticity           Prob > F        =     0.0001
                                                  R-squared       =     0.9408
                                                  Adj R-squared   =     0.9347
                                                  Within R-sq.    =     0.1408
Number of clusters (pro)     =         30         Root MSE        =     0.1765

                                   (Std. Err. adjusted for 30 clusters in pro)
------------------------------------------------------------------------------
             |               Robust
        lnci |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        pre6 |   .2076109   .0939738     2.21   0.035     .0154129    .3998089
        pre5 |   .1051003    .057062     1.84   0.076    -.0116047    .2218053
        pre4 |   .0801337   .0550019     1.46   0.156    -.0323577    .1926252
        pre3 |   .1080589   .0453272     2.38   0.024     .0153543    .2007634
        pre2 |   .0842464   .0227338     3.71   0.001     .0377507    .1307422
     current |   .1776746   .0542038     3.28   0.003     .0668155    .2885337
        post |  -.2033604   .0704668    -2.89   0.007    -.3474811   -.0592397
       post1 |   .1328196   .0520221     2.55   0.016     .0264224    .2392168
       post2 |          0  (omitted)
       post3 |          0  (omitted)
       post4 |          0  (omitted)
       post5 |          0  (omitted)
       post6 |          0  (omitted)
       _cons |    .989278   .0099459    99.47   0.000     .9689364     1.00962
------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
        year |        20           1          19     |
         pro |        30          30           0    *|
-----------------------------------------------------+
* = FE nested within cluster; treated as redundant for DoF computation

.
end of do-file
代码:*事件研究法///多期did要生成个体维度和政策维度的虚拟变量
gen tpilot=2013 if (pro_1==4|pro_1==7|pro_1==1|pro_1==12)
replace tpilot=2014 if pro==21
replace tpilot=2014 if pro==27
replace tpilot=2016 if pro==24
gen policy=year-tpilot //生产政策时点前后期数,tpilot是政策实施的时点
table policy //了解数据情况
replace policy = -6 if policy < -6
///根据政策时点前后期数event,生成表示政策时点前后各期的虚拟变量,*第一步,生成变量d_j、dj、current。

forvalues i=6(-1)1{
  gen pre`i'=(policy==-`i'& treat==1)
}

gen current=(policy==0 & treat==1)  /////第一步,生成变量prej、postj、current。

forvalues i=1(1)6{
  gen post`i'=(policy==`i'& policy==1)
}

drop pre1

///丢掉一期作为基准组
reghdfe lnci pre* current post* lnpopi lnpgdp tegdp lntech lnfin lnte si, absorb(year pro) vce(cluster pro)  //回归呈现政策前后各期的系数变化

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群