|
/***安慰剂实验
xtset Stkcd year
***y
reghdfe y x, absorb (id year) vce(cluster id)
cap erase "simulations.dta"
permute x beta =_b[x] se=_se[x] df=e(df_r), reps(500) seed(123) saving(".\simulations.dta",replace): reghdfe y x, absorb (id year) vce(cluster id)
use ".\simulations.dta",clear
gen t_value =beta/se
gen p_value =2 * ttail(df, abs(beta/se))
dpplot beta, xline(0.2389, lc(black*0.5)) lp(dash) xline(0, lc(black*0.5) lp(solid)) xtitle("Estimator", size(*0.8)) ytitle("Density", size(*0.8))
graph save p3, replace
|