作者:梁淑珍 (華僑大學(xué)) 溫馨提示: 文中鏈接在微信中無法生效。請點(diǎn)擊底部「閱讀原文」,?;蛑苯娱L按/掃描如下二維碼,直達(dá)原文:? 編者按:本文主要摘譯自下文,,特此致謝,! Source:De Chaisemartin C, D'Haultfoeuille X. Two-way fixed effects and differences-in-differences with heterogeneous treatment effects: A survey[R]. National Bureau of Economic Research, 2022. -PDF- 目錄 1. 引言 2. 模擬數(shù)據(jù)的生成 3. 異質(zhì)性穩(wěn)健 DID 估計(jì)量 3.1 did_imputation 3.2 did_multiplegt 3.3 csdid 3.4 eventstudyinteract 3.5 did2s 3.6 stackedev 3.7 TWFE OLS 3.8 xtevent 3.9 eventdd 4. 相關(guān)推文 連享會推文「DID 最新進(jìn)展:異質(zhì)性處理?xiàng)l件下的雙向固定效應(yīng) DID 估計(jì)量 (TWFEDD)」從理論角度詳細(xì)介紹了異質(zhì)性處理情況下 TWFE 估計(jì)量存在的問題,并對學(xué)者提出的診斷及修正方法進(jìn)行了回顧與梳理,。本文側(cè)重于介紹論文中提及的部分異質(zhì)性穩(wěn)健 DID 估計(jì)量的 Stata 命令,。 1. 引言 雙向固定效應(yīng)回歸 (Two-way Fixed Effects,TWFE) 是識別處理效應(yīng)最常用的估計(jì)方法之一,,但是要想得到無偏的平均處理效應(yīng)需要滿足以下假設(shè): 平行趨勢假定,; 處理效應(yīng)無組群和不同時(shí)點(diǎn)的異質(zhì)性。 然而在現(xiàn)實(shí)情況下,,假設(shè) (2) 很難得到滿足,。因此 TWFE 估計(jì)量得到的估計(jì)系數(shù)很可能存在偏誤,甚至產(chǎn)生錯誤比較和負(fù)權(quán)重等問題,。很多學(xué)者提出了 TWFE 的替代估計(jì)方法,,本文將展示這些異質(zhì)性穩(wěn)健 DID 估計(jì)量的 Stata 操作。 2. 模擬數(shù)據(jù)的生成 本文使用的基礎(chǔ)數(shù)據(jù)結(jié)構(gòu)為 300 個體 × 15 時(shí)期 = 4500 個觀察值的平衡面板數(shù)據(jù),。后文中的估計(jì)量均使用這份模擬數(shù)據(jù),。 . clear all . timer clear . * 設(shè)定隨機(jī)數(shù)種子, 設(shè)置 4500 個樣本觀測值 . set seed 10 . global T = 15 . global I = 300 . set obs `=$I*$T' . * 生成 id 與時(shí)間 . gen i = int((_n-1)/$T )+1 . gen t = mod((_n-1),$T )+1 . tsset i t . * 隨機(jī)生成每個 i d首次接受處理的時(shí)間標(biāo)志, Ei 的取值在 10 和 16 之間 . gen Ei = ceil(runiform()*7)+$T -6 if t==1 . bys i (t): replace Ei = Ei[1] . * 生成處理變量, K 為相對處理時(shí)間, D 為處理時(shí)間啞變量 . gen K = t-Ei . gen D = K>=0 & Ei!=. . * 生成時(shí)間上的異質(zhì)性處理效應(yīng) . gen tau = cond(D==1, (t-12.5), 0) . * 生成誤差項(xiàng) . gen eps = rnormal() . * 生成結(jié)果變量Y . gen Y = i + 3*t + tau*D + eps 3. 異質(zhì)性穩(wěn)健 DID 估計(jì)量 3.1 did_imputation Borusyak 等 (2021) 提供了一種基于插補(bǔ)的反事實(shí)方法解決 TWFE 的估計(jì)偏誤問題?;?TWFE,,通過估計(jì)組群固定效應(yīng)、時(shí)間固定效應(yīng)和處理組-控制組固定效應(yīng),,可以得到更準(zhǔn)確的估計(jì)量,,具體可參考連享會推文「Stata:事件研究法的穩(wěn)健有效估計(jì)量-did_imputation」。. did_imputation Y i t Ei, allhorizons pretrends(5) Number of obs = 4,500 ------------------------------------------------------------------------------ Y | Coefficient Std. err. z P>|z| [95% conf. interval] -------------+---------------------------------------------------------------- tau0 | 0.085 0.080 1.07 0.284 -0.071 0.242 tau1 | 0.670 0.084 7.99 0.000 0.505 0.834 tau2 | 1.084 0.101 10.71 0.000 0.885 1.282 tau3 | 1.605 0.133 12.04 0.000 1.343 1.866 tau4 | 1.919 0.153 12.53 0.000 1.619 2.219 tau5 | 2.651 0.243 10.90 0.000 2.175 3.128 pre1 | -0.089 0.124 -0.72 0.474 -0.333 0.155 pre2 | -0.022 0.106 -0.21 0.833 -0.231 0.186 pre3 | -0.067 0.100 -0.67 0.506 -0.264 0.130 pre4 | -0.014 0.088 -0.16 0.869 -0.187 0.158 pre5 | -0.033 0.071 -0.47 0.639 -0.174 0.107 ------------------------------------------------------------------------------ 可以看出,,pre1-pre5 的 值均不顯著,,該數(shù)據(jù)集滿足平行趨勢假設(shè),tau1-tau4 的 值顯著,,表現(xiàn)為異質(zhì)性處理效應(yīng),。進(jìn)一步使用 event_plot 命令,,將不同時(shí)期的處理效應(yīng)系數(shù)繪制出來。 . event_plot, default_look graph_opt(xtitle('Periods since the event') ytitle('Average causal effect') /// > title('Borusyak et al. (2021) imputaion estimator') xlabel(-5(1)5) name(BJS, replace)) together 3.2 did_multiplegt De Chaisemartin 和 D'Haultfoeuille (2020) 提出通過加權(quán)計(jì)算兩種處理效應(yīng)的值得到平均處理效應(yīng)的無偏估計(jì),,這兩種處理效應(yīng)為: 期未受處理而 期受處理的組與兩期都未處理的組的平均處理效應(yīng),; 期受處理而 期未受處理的組與兩期都受處理的組的平均處理效應(yīng)。 該方法的前提條件是處理效應(yīng)不具有動態(tài)性 (即處理效應(yīng)與過去的處理狀態(tài)無關(guān)),,具體可參考連享會推文「DIDM:多期多個體倍分法-did_multiplegt」,。. did_multiplegt Y i t D, robust_dynamic dynamic(5) placebo(5) longdiff_placebo breps(100) cluster(i) | Estimate SE LB CI UB CI N Switchers -------------+------------------------------------------------------------------ Effect_0 | .1408578 .1581723 -.16916 .4508756 1211 250 Effect_1 | .7141733 .1371814 .4452979 .9830488 899 205 Effect_2 | 1.132017 .1400374 .8575438 1.40649 628 164 Effect_3 | 1.565301 .1709356 1.230268 1.900335 398 117 Effect_4 | 1.899413 .2036894 1.500182 2.298644 215 70 Effect_5 | 2.773816 .3108357 2.164578 3.383054 83 33 Placebo_1 | .0482671 .1020707 -.1517915 .2483257 1211 250 Placebo_2 | .0460625 .1096916 -.1689331 .261058 899 205 Placebo_3 | .0305153 .1082104 -.1815771 .2426078 628 164 Placebo_4 | -.0692496 .1461691 -.355741 .2172418 398 117 Placebo_5 | .0299686 .1821709 -.3270864 .3870236 215 70 繪制各期處理效應(yīng)圖: . event_plot e(estimates)#e(variances), default_look graph_opt(xtitle('Periods since the event') /// > ytitle('Average causal effect') title('de Chaisemartin and D'Haultfoeuille (2020)') /// > xlabel(-5(1)5) name(dCdH, replace)) stub_lag(Effect_#) stub_lead(Placebo_#) together 3.3 csdid Callaway 和 SantAnna (2021) 將 期以前從未受處理的組作為控制組進(jìn)行估計(jì),代碼如下:. * 生成日期變量,,從未受處理的組取值為 0 . gen gvar = cond(Ei>15, 0, Ei) . csdid Y, ivar(i) time(t) gvar(gvar) agg(event) Difference-in-difference with Multiple Time Periods Number of obs = 4,500 Outcome model : weighted least squares Treatment model: inverse probability tilting ------------------------------------------------------------------------------ | Coefficient Std. err. z P>|z| [95% conf. interval] -------------+---------------------------------------------------------------- T-13 | 0.219 0.321 0.68 0.496 -0.411 0.849 T-12 | 0.127 0.185 0.69 0.492 -0.236 0.491 T-11 | -0.025 0.144 -0.17 0.861 -0.307 0.257 T-10 | -0.188 0.128 -1.47 0.140 -0.438 0.062 T-9 | 0.141 0.110 1.28 0.199 -0.074 0.357 T-8 | 0.019 0.102 0.18 0.855 -0.182 0.219 T-7 | 0.068 0.101 0.67 0.501 -0.129 0.265 T-6 | 0.038 0.094 0.40 0.688 -0.146 0.221 T-5 | -0.048 0.092 -0.52 0.606 -0.228 0.133 T-4 | -0.020 0.096 -0.21 0.834 -0.209 0.168 T-3 | -0.081 0.092 -0.88 0.378 -0.262 0.099 T-2 | 0.037 0.104 0.35 0.723 -0.167 0.241 T-1 | -0.102 0.097 -1.05 0.293 -0.291 0.088 T+0 | 0.106 0.147 0.72 0.474 -0.183 0.395 T+1 | 0.632 0.146 4.33 0.000 0.346 0.918 T+2 | 0.995 0.160 6.21 0.000 0.681 1.308 T+3 | 1.465 0.184 7.98 0.000 1.105 1.825 T+4 | 1.821 0.218 8.34 0.000 1.393 2.248 T+5 | 2.774 0.289 9.60 0.000 2.208 3.340 ------------------------------------------------------------------------------ Control: Never Treated See Callaway and Sant'Anna (2021) for details . 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 和 Abraham (2020) 認(rèn)為還能夠使用后處理組作為控制組,,允許使用簡單的線性回歸進(jìn)行估計(jì),代碼如下:. sum Ei . * 生成從未受處理組的虛擬變量 . gen lastcohort = Ei==r(max) . * 生成各期處理組的虛擬變量 . forvalues l = 0/5 { 2. gen L`l'event = K==`l' 3. } . forvalues l = 1/14 { 2. gen F`l'event = K==-`l' 3. } . drop F1event . eventstudyinteract Y L*event F*event, vce(cluster i) absorb(i t) cohort(Ei) control_cohort(lastcohort) IW estimates for dynamic effects Number of obs = 4,500 Absorbing 2 HDFE groups F(84, 299) = 9.76 Prob > F = 0.0000 R-squared = 0.9999 Adj R-squared = 0.9999 Root MSE = 1.0191 (Std. err. adjusted for 300 clusters in i) ------------------------------------------------------------------------------ | Robust Y | Coefficient std. err. t P>|t| [95% conf. interval] -------------+---------------------------------------------------------------- L0event | 0.106 0.148 0.71 0.477 -0.186 0.397 L1event | 0.632 0.147 4.30 0.000 0.343 0.921 L2event | 0.995 0.161 6.16 0.000 0.677 1.312 L3event | 1.465 0.186 7.89 0.000 1.100 1.831 L4event | 1.821 0.221 8.24 0.000 1.386 2.255 L5event | 2.774 0.293 9.48 0.000 2.198 3.350 F2event | 0.102 0.098 1.04 0.300 -0.091 0.295 F3event | 0.065 0.098 0.66 0.511 -0.129 0.258 F4event | 0.146 0.110 1.33 0.183 -0.069 0.362 F5event | 0.166 0.116 1.44 0.152 -0.062 0.394 F6event | 0.214 0.126 1.70 0.091 -0.034 0.462 F7event | 0.176 0.130 1.35 0.178 -0.080 0.433 F8event | 0.109 0.132 0.83 0.410 -0.150 0.367 F9event | 0.090 0.130 0.69 0.492 -0.167 0.346 F10event | -0.055 0.138 -0.40 0.693 -0.327 0.218 F11event | 0.165 0.140 1.18 0.239 -0.110 0.441 F12event | 0.247 0.161 1.53 0.128 -0.071 0.564 F13event | 0.082 0.209 0.39 0.697 -0.330 0.493 F14event | -0.072 0.299 -0.24 0.810 -0.661 0.516 ------------------------------------------------------------------------------ 如果出現(xiàn)報(bào)錯 command avar is unrecognized,,則輸入 ssc install avar,,安裝后再次運(yùn)行命令。 . event_plot e(b_iw)#e(V_iw), default_look graph_opt(xtitle('Periods since the event') /// > ytitle('Average causal effect') xlabel(-14(1)5) title('Sun and Abraham (2020)') /// > name(SA, replace)) stub_lag(L#event) stub_lead(F#event) together 3.5 did2s Gardner (2021) 提出的兩階段雙重差分的基本原理:在第一階段識別組群處理效應(yīng)和時(shí)期處理效應(yīng)的異質(zhì)性,,在第二階段時(shí)再將異質(zhì)性處理效應(yīng)剔除,,具體可參考連享會推文「Stata 倍分法新趨勢:did2s-兩階段雙重差分模型」。. did2s Y, first_stage(i.i i.t) second_stage(F*event L*event) treatment(D) cluster(i) (Std. err. adjusted for clustering on i) ------------------------------------------------------------------------------ | Coefficient Std. err. z P>|z| [95% conf. interval] -------------+---------------------------------------------------------------- F2event | 0.026 0.050 0.51 0.609 -0.073 0.124 F3event | -0.026 0.052 -0.49 0.622 -0.129 0.077 F4event | 0.017 0.054 0.32 0.748 -0.088 0.122 F5event | -0.009 0.050 -0.18 0.853 -0.108 0.089 F6event | 0.021 0.053 0.39 0.695 -0.084 0.126 F7event | 0.031 0.053 0.60 0.550 -0.072 0.134 F8event | -0.015 0.056 -0.26 0.795 -0.124 0.095 F9event | 0.017 0.054 0.31 0.756 -0.089 0.122 F10event | -0.090 0.062 -1.46 0.143 -0.211 0.031 F11event | 0.048 0.061 0.79 0.432 -0.071 0.167 F12event | 0.072 0.069 1.04 0.299 -0.064 0.207 F13event | -0.004 0.080 -0.05 0.957 -0.162 0.153 F14event | -0.121 0.093 -1.30 0.194 -0.304 0.062 L0event | 0.085 0.136 0.63 0.531 -0.182 0.353 L1event | 0.670 0.128 5.25 0.000 0.420 0.919 L2event | 1.084 0.130 8.37 0.000 0.830 1.338 L3event | 1.605 0.153 10.48 0.000 1.305 1.905 L4event | 1.919 0.168 11.41 0.000 1.589 2.248 L5event | 2.651 0.243 10.90 0.000 2.175 3.128 ------------------------------------------------------------------------------ . event_plot, default_look stub_lag(L#event) stub_lead(F#event) together /// > graph_opt(xtitle('Periods since the event') ytitle('Average causal effect') /// > xlabel(-14(1)5) title('Gardner (2021)') name(DID2S, replace)) 3.6 stackedev 與計(jì)算加權(quán) ATT 的方法相比,,Cengiz 等 (2019) 認(rèn)為堆疊 (Stacking) 也是解決 TWFE 估計(jì)偏誤的替代方法,,基本思路是將數(shù)據(jù)集重建為相對事件時(shí)間的平衡面板,然后控制組群效應(yīng)和時(shí)間固定效應(yīng),,以得到處理效應(yīng)的加權(quán)平均值,。. gen treat_year=. . replace treat_year=Ei if Ei!=16 . * 生成從未受處理的虛擬變量 . gen no_treat= (Ei==16) . cap drop F*event L*event . sum Ei . forvalues l = 0/5 { 2. gen L`l'event = K==`l' 3. replace L`l'event = 0 if no_treat==1 4. } . forvalues l = 1/14 { 2. gen F`l'event = K==-`l' 3. replace F`l'event = 0 if no_treat==1 4. } . drop F1event . * 運(yùn)行 stackedev 命令 . preserve . stackedev Y F*event L*event, cohort(treat_year) time(t) never_treat(no_treat) unit_fe(i) clust_unit(i) . restore HDFE Linear regression Number of obs = 8,250 Absorbing 2 HDFE groups F( 19, 508) = 27.30 Statistics robust to heteroskedasticity Prob > F = 0.0000 R-squared = 0.9999 Adj R-squared = 0.9998 Within R-sq. = 0.0658 Number of clusters (unit_stack) = 509 Root MSE = 1.0677 (Std. err. adjusted for 509 clusters in unit_stack) ------------------------------------------------------------------------------ | Robust Y | Coefficient std. err. t P>|t| [95% conf. interval] -------------+---------------------------------------------------------------- F2event | 0.108 0.122 0.89 0.373 -0.131 0.347 F3event | 0.063 0.121 0.52 0.603 -0.174 0.300 F4event | 0.141 0.123 1.15 0.250 -0.100 0.383 F5event | 0.163 0.120 1.36 0.175 -0.073 0.399 F6event | 0.210 0.127 1.66 0.097 -0.038 0.459 F7event | 0.170 0.125 1.36 0.174 -0.075 0.416 F8event | 0.103 0.125 0.83 0.408 -0.142 0.349 F9event | 0.093 0.122 0.76 0.447 -0.147 0.332 F10event | -0.158 0.130 -1.22 0.225 -0.414 0.098 F11event | -0.068 0.136 -0.50 0.618 -0.334 0.199 F12event | -0.120 0.147 -0.82 0.411 -0.408 0.167 F13event | -0.316 0.183 -1.73 0.084 -0.675 0.042 F14event | -0.456 0.234 -1.95 0.051 -0.915 0.003 L0event | 0.046 0.145 0.32 0.751 -0.239 0.332 L1event | 0.658 0.149 4.43 0.000 0.366 0.950 L2event | 1.132 0.148 7.65 0.000 0.841 1.423 L3event | 1.810 0.167 10.81 0.000 1.481 2.139 L4event | 2.347 0.185 12.72 0.000 1.985 2.710 L5event | 3.370 0.251 13.42 0.000 2.877 3.863 _cons | 168.183 0.038 4390.68 0.000 168.108 168.259 ------------------------------------------------------------------------------ . event_plot e(b)#e(V), default_look graph_opt(xtitle('Periods since the event') /// > ytitle('Average causal effect') xlabel(-14(1)5) title('Cengiz et al. (2019)') /// > name(CDLZ, replace)) stub_lag(L#event) stub_lead(F#event) together 3.7 TWFE OLS 多維固定效應(yīng) OLS 代碼:. reghdfe Y F*event L*event, absorb(i t) vce(cluster i) HDFE Linear regression Number of obs = 4,500 Absorbing 2 HDFE groups F( 19, 299) = 9.24 Statistics robust to heteroskedasticity Prob > F = 0.0000 R-squared = 0.9999 Adj R-squared = 0.9998 Within R-sq. = 0.0402 Number of clusters (i) = 300 Root MSE = 1.0769 (Std. err. adjusted for 300 clusters in i) ------------------------------------------------------------------------------ | Robust Y | Coefficient std. err. t P>|t| [95% conf. interval] -------------+---------------------------------------------------------------- F2event | 0.152 0.094 1.61 0.108 -0.034 0.337 F3event | 0.077 0.096 0.81 0.418 -0.111 0.265 F4event | 0.042 0.104 0.40 0.687 -0.162 0.246 F5event | -0.056 0.102 -0.55 0.580 -0.257 0.144 F6event | -0.084 0.110 -0.76 0.446 -0.300 0.132 F7event | -0.145 0.112 -1.29 0.197 -0.366 0.076 F8event | -0.244 0.120 -2.04 0.043 -0.480 -0.008 F9event | -0.322 0.124 -2.60 0.010 -0.565 -0.078 F10event | -0.577 0.137 -4.22 0.000 -0.846 -0.308 F11event | -0.495 0.140 -3.53 0.000 -0.770 -0.219 F12event | -0.553 0.161 -3.44 0.001 -0.870 -0.236 F13event | -0.867 0.184 -4.72 0.000 -1.229 -0.505 F14event | -1.046 0.226 -4.62 0.000 -1.492 -0.601 L0event | -0.168 0.126 -1.33 0.183 -0.416 0.080 L1event | 0.358 0.113 3.17 0.002 0.136 0.581 L2event | 0.610 0.118 5.18 0.000 0.379 0.842 L3event | 0.978 0.142 6.87 0.000 0.698 1.258 L4event | 1.159 0.160 7.25 0.000 0.844 1.473 L5event | 1.634 0.221 7.39 0.000 1.199 2.070 _cons | 174.690 0.064 2719.06 0.000 174.564 174.817 ------------------------------------------------------------------------------ . event_plot, default_look stub_lag(L#event) stub_lead(F#event) together /// > graph_opt(xtitle('Days since the event') ytitle('OLS coefficients') /// > xlabel(-14(1)5) title('OLS') name(OLS, replace)) 3.8 xtevent Freyaldenhoven 等 (2019) 提出處理面板事件研究的估計(jì)方法,,代碼如下:. xtevent Y, policyvar(D) panelvar(i) timevar(t) window(4) plot Linear regression, absorbing indicators Number of obs = 1,800 Absorbed variable: i No. of categories = 300 F(11, 1489) = 3952.82 Prob > F = 0.0000 R-squared = 0.9999 Adj R-squared = 0.9999 Root MSE = 1.0234 ------------------------------------------------------------------------------ Y | Coefficient Std. err. t P>|t| [95% conf. interval] -------------+---------------------------------------------------------------- _k_eq_m5 | -0.074 0.170 -0.44 0.663 -0.408 0.260 _k_eq_m4 | -0.088 0.139 -0.63 0.526 -0.361 0.185 _k_eq_m3 | -0.049 0.133 -0.37 0.713 -0.309 0.212 _k_eq_m2 | -0.014 0.129 -0.11 0.911 -0.268 0.239 _k_eq_p0 | -2.034 0.162 -12.53 0.000 -2.353 -1.716 _k_eq_p1 | -1.458 0.227 -6.43 0.000 -1.903 -1.013 _k_eq_p2 | 0.000 (omitted) _k_eq_p3 | 0.000 (omitted) _k_eq_p4 | 0.000 (omitted) _k_eq_p5 | 0.000 (omitted) t | 7 | 3.025 0.085 35.74 0.000 2.859 3.191 8 | 5.874 0.089 66.25 0.000 5.700 6.048 9 | 8.992 0.097 92.30 0.000 8.801 9.183 10 | 12.006 0.111 107.77 0.000 11.787 12.225 11 | 15.039 0.133 112.95 0.000 14.778 15.300 | _cons | 168.563 0.175 965.67 0.000 168.220 168.905 ------------------------------------------------------------------------------ F test of absorbed indicators: F(299, 1489) = 4.3e+04 Prob > F = 0.000 Warning: Some event-time dummies were omitted in the regression. These coefficients will be shown as zero in the plot. Check the window and the instruments, if any. 3.9 eventdd eventdd 是 Damian Clarke 和 Kathya Tapia (2020) 共同開發(fā)的事件研究法代碼,,具體可參考連享會推文「Stata:面板事件研究法-eventdd」,。 . eventdd Y i.t,timevar(K) method(fe, cluster(i)) balanced graph_op(ytitle('Y')) note: lead15 omitted because of collinearity Fixed-effects (within) regression Number of obs = 4500 Group variable: i Number of groups = 300 R-sq: Within = 0.9939 Obs per group: min = 15 Between = 0.0028 avg = 15.0 Overall = 0.0228 max = 15 F(33,299) = 19538.43 corr(u_i, Xb) = -0.0006 Prob > F = 0.0000 (Std. err. adjusted for 300 clusters in i) ------------------------------------------------------------------------------ | Robust Y | Coefficient std. err. t P>|t| [95% conf. interval] -------------+---------------------------------------------------------------- t | 2 | 2.926 0.091 31.99 0.000 2.746 3.106 3 | 5.867 0.086 67.84 0.000 5.697 6.037 4 | 8.771 0.084 104.41 0.000 8.606 8.936 5 | 11.772 0.093 126.73 0.000 11.589 11.955 6 | 14.734 0.103 143.72 0.000 14.533 14.936 7 | 17.689 0.112 157.52 0.000 17.468 17.910 8 | 20.509 0.113 181.12 0.000 20.286 20.731 9 | 23.640 0.116 203.61 0.000 23.411 23.868 10 | 26.458 0.140 189.33 0.000 26.183 26.733 11 | 29.295 0.135 216.99 0.000 29.029 29.560 12 | 32.439 0.137 236.15 0.000 32.169 32.709 13 | 35.815 0.154 232.85 0.000 35.512 36.117 14 | 39.351 0.168 234.66 0.000 39.021 39.681 15 | 43.222 0.197 219.04 0.000 42.833 43.610 | lead15 | 0.000 (omitted) lead14 | -0.236 0.179 -1.32 0.188 -0.588 0.116 lead13 | -0.126 0.152 -0.83 0.406 -0.425 0.172 lead12 | -0.034 0.149 -0.23 0.819 -0.326 0.258 lead11 | -0.018 0.132 -0.14 0.889 -0.279 0.242 lead10 | -0.095 0.126 -0.76 0.450 -0.343 0.152 lead9 | 0.106 0.119 0.89 0.374 -0.128 0.340 lead8 | 0.127 0.110 1.15 0.251 -0.090 0.344 lead7 | 0.220 0.100 2.20 0.028 0.023 0.417 lead6 | 0.295 0.101 2.93 0.004 0.097 0.493 lead5 | 0.350 0.091 3.84 0.000 0.170 0.529 lead4 | 0.423 0.091 4.66 0.000 0.245 0.602 lead3 | 0.371 0.086 4.33 0.000 0.202 0.539 lead2 | 0.321 0.084 3.83 0.000 0.156 0.486 lag0 | 0.078 0.130 0.60 0.550 -0.178 0.333 lag1 | 0.579 0.122 4.75 0.000 0.339 0.819 lag2 | 0.808 0.132 6.12 0.000 0.548 1.068 lag3 | 1.153 0.162 7.14 0.000 0.835 1.471 lag4 | 1.313 0.183 7.17 0.000 0.953 1.674 lag5 | 1.761 0.246 7.17 0.000 1.277 2.244 _cons | 153.565 0.117 1314.12 0.000 153.335 153.795 -------------+---------------------------------------------------------------- sigma_u | 86.770012 sigma_e | 1.0779864 rho | .99984568 (fraction of variance due to u_i) ------------------------------------------------------------------------------ 此外,還有 drdid、flexpaneldid,、staggered,、jwdid 等命令,。在實(shí)際應(yīng)用過程中,,為了解決 TWFE 估計(jì)偏誤的問題,,不妨將上述異質(zhì)性穩(wěn)健估計(jì)量都使用一遍,若能夠通過大部分的估計(jì)量檢驗(yàn),,那么結(jié)果就是可靠的,。 4. 相關(guān)推文 Note:產(chǎn)生如下推文列表的 Stata 命令為: lianxh did, m 安裝最新版 lianxh 命令: ssc install lianxh, replace 專題:倍分法DID DID偏誤問題:多時(shí)期DID的雙重穩(wěn)健估計(jì)量(下)-csdid DID偏誤問題:兩時(shí)期DID的雙重穩(wěn)健估計(jì)量(上)-drdid Stata+R:合成DID原理及實(shí)現(xiàn)-sdid DID的陷阱和注意事項(xiàng) Stata:事件研究法的穩(wěn)健有效估計(jì)量-did_imputation DID最新進(jìn)展:異質(zhì)性處理?xiàng)l件下的雙向固定效應(yīng)DID估計(jì)量 (TWFEDD) Stata倍分法新趨勢:did2s-兩階段雙重差分模型 DID陷阱解析-L111 DIDM:多期多個體倍分法-did_multiplegt 面板PSM+DID如何做匹配? 倍分法:DID是否需要隨機(jī)分組,? Fuzzy DID:模糊倍分法 DID:僅有幾個實(shí)驗(yàn)組樣本的倍分法 (雙重差分) 考慮溢出效應(yīng)的倍分法:spillover-robust DID tfdiff:多期DID的估計(jì)及圖示 倍分法DID:一組參考文獻(xiàn) Stata:雙重差分的固定效應(yīng)模型-(DID) 倍分法(DID)的標(biāo)準(zhǔn)誤:不能忽略空間相關(guān)性 多期DID之安慰劑檢驗(yàn),、平行趨勢檢驗(yàn) DID邊際分析:讓政策評價(jià)結(jié)果更加豐滿 Big Bad Banks:多期 DID 經(jīng)典論文介紹 多期DID:平行趨勢檢驗(yàn)圖示 Stata:多期倍分法 (DID) 詳解及其圖示 課程推薦:因果推斷實(shí)用計(jì)量方法 主講老師:丘嘉平教授 ?? 課程主頁:https:///lianxh/YGqjp? New! Stata 搜索神器:lianxh 和 songbl GIF 動圖介紹 搜: 推文,、數(shù)據(jù)分享,、期刊論文,、重現(xiàn)代碼 …… ?? 安裝: . ssc install lianxh . ssc install songbl ?? 使用: . lianxh DID 倍分法 . songbl all |
|