关于DID平行趋势检验基准组的选择
为什么需要基准组?
基期还是-1期?
** 选择基期作为基准组
preserve
drop pre7 //删除基期
reghdfe lnrso pre* current post* $xlist ,absorb(id year) vce(cluster id)
coefplot, baselevels ///
keep(pre* current post*) ///
vertical ///转置图形
coeflabels(pre6=-6 pre5=-5 pre4=-4 pre3=-3 pre2=-2 pre1=-1 ///
current=0 post1=1 post2=2 post3=3) ///
yline(0,lwidth(vthin) lpattern(solid) lcolor(teal)) ///
xline(7,lwidth(vthin) lpattern(solid) lcolor(teal)) ///
ylabel(-0.8(0.2)0.2,labsize(*0.85) angle(0)) xlabel(,labsize(*0.85)) ///
ytitle('Coefficients') ///
msymbol(O) msize(small) mcolor(gs1) ///plot样式
addplot(line @b @at,lcolor(gs1) lwidth(medthick)) ///增加点之间的连线
ciopts(recast(rline) lwidth(thin) lpattern(dash) lcolor(gs2)) ///置信区间样式
graphregion(color(white)) //白底
restore
** 选择-1期作为基准组preservedrop pre1 //删除-1期reghdfe lnrso pre* current post* $xlist ,absorb(id year) vce(cluster id)
coefplot, baselevels ///keep(pre* current post*) ///vertical ///转置图形coeflabels(pre7=-7 pre6=-6 pre5=-5 pre4=-4 pre3=-3 pre2=-2 ///current=0 post1=1 post2=2 post3=3) /// yline(0,lwidth(vthin) lpattern(solid) lcolor(teal)) ///xline(7,lwidth(vthin) lpattern(solid) lcolor(teal)) ///ylabel(-0.8(0.2)0.2,labsize(*0.85) angle(0)) xlabel(,labsize(*0.85)) ///ytitle('Coefficients') ///msymbol(O) msize(small) mcolor(gs1) ///plot样式addplot(line @b @at,lcolor(gs1) lwidth(medthick)) ///增加点之间的连线ciopts(recast(rline) lwidth(thin) lpattern(dash) lcolor(gs2)) ///置信区间样式graphregion(color(white)) //白底restore
赞 (0)