事件研究法(Event Study):估计不同暴露时间(exposure time)的效应,但Sun & Abraham (2021) 显示其仍隐含动态效应同质性假设 灵活模型:如Callaway & Sant’Anna (2021) 的队列-时间ATT估计,Borusyak等 (2024) 的插补法。 Stata实现: 基础命令(regress,xtreg)已足够,但代
vce(clustercity_id)matC=e(b_iw)matast_matrix("A",sqrt(st_matrix("e(V_iw)")))matC=C\AmatlistC*eventstudyinteractlnemissionsg_*g0-g8,///cohort(first_year)control_cohort(never_treat)///covariates($controlslnworkers)///absorb(i.city_idi.year)vce(clustercity_id)matD=e(b_iw)matast...
本文是《An Introductory Guide to Event Study Models》的代码学习记录,第三部分要解决的是 stata 的代码部分。 放个锐评先( 简单回顾事件研究法的概念 从操作上上讲:回归一般估计的是平均处理效应,而事件研究法就是把平均效应按照时间切片。 从统计意义上讲:每个虚拟时间段就有了个系数,连起来就是平均处理效应的...
eventdd``xtreg``reghdfe``event_plot``eventdd``eventdd``matsort 平行趋势检验代码汇总 ***EventStudyPlots*** genrel_time=year-_nfd *install"eventdd"and"matsort" 选择方法为 "xtreg". eventddasmrspcincasmrhcasesi.year,/// timevar(rel_time)method(fe,cluster(stfips))/// nolinegraph_op(...
对于在Stata中使用和绘制多个DiD包,强烈推荐Kirill Borusyak的event_plot命令(ssc install event_plot, replace)。它估计并组合来自五个不同估计的结果。在GitHub上的five_estimators_example.do文档中给出了如何使用不同包绘制事件研究图的示例 event_...
. event_plot e(b)#e(V), default_look graph_opt(xtitle('Periods since the event') ///> ytitle('Average causal effect') xlabel(-14(1)5) title('Callaway and Sant'Anna (2020)') ///> name(CS, replace)) stub_lag(T #) stub_lead(T-#) together 3.4 eventstudyinteract Sun 和 ...
STACKEDEV: Stata module to implement stacked event study estimator 22 EVENT_PLOT: Stata module to plot the staggered-adoption diff-in-diff ("event study") estimates 23 BALANCETABLE: Stata module to build a balance table and print it in a LaTeX file or an Excel file ...
event_plot command ( ssc install event_plot, replace ) by Kirill Borusyakis highly recommended. It estimates and combines results from five different estimators. Example of how to do event study plots using different packages is given in the five_estimators_example.do dofile on GitHub. ...
event_plot, default_lookgraph_opt(xtitle("相对处理时点")ytitle("处理效应")xlabel(-5(1)5))该方法通过分时处理队列计算ATT,特别处理了处理时点与协变量相关的偏误。注意需检查平行趋势假设,建议配合bacondecomp命令进行分解诊断。方法二:Sun& Abraham (2021)事件研究法 构造动态处理效应模型:eventstudy...
clear all timer clear * 设定 1500 个观察值及其他暂元 set seed 10 global T = 15 global I = 100 global pre 5 global post 8 global ep event_plot global g0 "default_look" global g1 xla(-$pre (1) $post) // global g1 xla(-5(1)5) global g2 xt("Periods since the event") glob...