我在别处买的,我搞不懂。分享给你们看看
***ESR模型估计
cls
use "Y:\ESR_example.dta",clear
movestay lnw x1 x2 x3 x4 x5 d1 d2 d3, select(treat=z1 z2)
***计算ATT
mspredict y11 if e(sample),yc1_1
mspredict y21 if e(sample), yc2_1
gen att=y11-y21
ttest y11==y21, unpaired
**计算ATU
mspredict y12 if e(sample), yc1_2
mspredict y22 if e(sample), yc2_2
gen atu=y12-y22
ttest y12==y22, unpaired
**计算ATE
mspredict y1 if e(sample), xb1
mspredict y0 if e(sample), xb2
gen ate=y1-y0
ttest y1==y0, unpaired
sum att atu ate