Companion code:resources/code/stata/03_did_modern.do(DID)、04_iv.do(IV)、05_rdd.do(RDD)、06_dml.do(DML)。
When to Use
- The empirical analysis consists only of OLS + control variables.
- DID uses TWFE but does not respond to recent criticisms of heterogeneous treatment effects.
- IV first stage is weak / concerns about instrument endogeneity.
- Planning to use double machine learning but unsure how to report it.
Design Priority
Preference ranking of Economic Research Journal editorial board members (strong → weak):
- Policy shock + DID (including staggered / continuous treatment)
- Regression discontinuity (clear policy threshold)
- Instrumental variables (strong instruments + exclusion argument)
- Propensity score matching + DID
- Synthetic control method
- Double machine learning / causal forest
- OLS + rigorous endogeneity discussion (acceptable in structural estimation / theoretical-empirical articles)
The journal explicitly opposes a "quantitative-only tendency": no matter how elegant the identification strategy, it must return to theory and China's institutional issues. Identification is a means, not a selling point.
Branch A: Staggered (multiple time point) DID — ★ most common and most easily criticized
Staggered DID cannot report only TWFE. The standard four-step process:
- TWFE baseline—the starting point familiar to readers (but may be biased under staggered treatment).
- Goodman-Bacon (2021) decomposition(
bacondecomp)—show the "bad comparison / negative weight" problem. - Heterogeneity-robust estimators as the main results(choose one from the table below as the main specification, with the others as robustness checks):
| Estimator | Paper | Stata | R |
|---|---|---|---|
| group-time ATT | Callaway & Sant'Anna (2021) | csdid |
did::att_gt |
| Interaction-weighted IW | Sun & Abraham (2021) | eventstudyinteract |
fixest::sunab |
| Imputation (most efficient) | Borusyak, Jaravel & Spiess (2024) | did_imputation |
didimputation |
| Two-stage | Gardner (2022) | did2s |
did2s |
| Non-binary/reversible treatment | de Chaisemartin & D'Haultfœuille (2020/24) | did_multiplegt_dyn |
DIDmultiplegtDYN |
* Callaway-Sant'Anna:gvar = 首次受处理年份,从不处理者 = 0
csdid Y X, ivar(id) time(year) gvar(gvar) method(dripw)
estat simple // 总体 ATT
estat event // 动态效应
- Event study plotTest parallel trends and dynamic effects (use the period before treatment as the baseline, 95% CI, vertical dashed line at the treatment time).
- Placebo: randomly assign treatment timing/units 500–1000 times, and see whether the true coefficient falls in the tail of the distribution (see
er-robustness)。
Pitfalls to avoid: "only looking at the plot without testing" parallel trends; anticipation effects/early responses; using TWFE event studies as the main dynamic results under staggered treatment (they may also be biased; use CS / SA for the main results).
Branch B: IV — report modern weak instrument diagnostics
Do not report only "F>10". The standard report has four elements:
- First-stage Kleibergen-Paap rk Wald F(valid under heteroskedasticity/clustering, replacing Cragg-Donald F).
- Compare against Stock-Yogo (2005) critical values.
- Effective F(Montiel Olea & Pflueger 2013,
weakivtest), a single endogenous variable is more reliable. - Weak-instrument-robust inference: Anderson-Rubin test and confidence intervals (
weakiv); under exact identification, AR is fully robust to weak instruments.
ivreg2 Y X (D = Z1 Z2), robust first // 自动报告 KP rk F、Hansen J
weakivtest // 有效 F
weakiv ivreg2 Y X (D = Z1 Z2), robust // AR / CLR / K 稳健区间
The exclusion argument should have at least three paragraphs: theory / institutions / placebo; and also report the reduced form. Benchmark against model papers(definitely in Economic Research Journal): Wang Yongqin and Dong Wen, "How Does the Rise of Robots Affect China's Labor Market?" (Issue 10, 2020)—constructs a Bartik / shift-share instrumental variable using the trend of robot penetration in U.S. industries, and argues for exogeneity and exclusion.
Branch C: RDD
rdplot Y X, c(0) p(1) kernel(triangular)
rdrobust Y X, c(0) p(1) kernel(triangular) bwselect(mserd) // 报告 Robust 行
rddensity X, c(0) // CJM 操纵检验
- The main estimate reports robust bias-corrected CI(the core contribution of Calonico-Cattaneo-Titiunik 2014), do not report only conventional CIs.
- For the manipulation test use
rddensity(Cattaneo-Jansson-Ma, which has superseded McCrary 2008). - Robustness: covariate continuity, ≥3 bandwidths, donut RD, placebo cutoffs.
- Benchmarking against model papers(confirmed to be in Economic Research Journal): Liu Shenglong, Zhou Shaojie, Hu Angang, "The Compulsory Education Law and Returns to Education in Urban China: Based on a Regression Discontinuity Design" (2016, Issue 2).
Branch D: DML double machine learning
Report: model type (partially linear PLR / interactive), number of cross-fitting folds K (5 or 10), nuisance function learners (lasso / random forest / gradient boosting) + learner robustness comparison, Neyman orthogonal score standard errors (Chernozhukov et al. 2018). Stata ddml+pystacked;Python DoubleML。
Branch E: structural estimation / theoretical empirics
Are the microfoundations clear? Are the identifying assumptions explicitly listed? Do the parameter estimates provide counterfactual analysis?
Standard errors
| Scenario | Approach | Command |
|---|---|---|
| Within-group correlation | Cluster-robust | reghdfe ..., vce(cluster id) |
| Two-dimensional correlation | Two-way clustering | vce(cluster firm year) |
| Too few clusters (<~40) | wild cluster bootstrap | boottest(see er-robustness) |
| Spatial correlation | Conley spatial HAC | acreg |
Execution bridge (StatsPAI / Stata MCP)
Actually run the designand audit it, rather than just describing it. For the complete mapping see
execution-with-mcp. Economic Research Journal is a top Chinese economics journal, and identification credibility is usually the binding constraint; staggered DID, weak-instrument-robust IV, RDD, and mechanism tests.
detect_design→recommend→ useas_handle=trueto fit →audit_resultto list the checks still owed.- **Observational causality:** staggered DID (
callaway_santanna/sun_abraham+bacon_decomposition+honest_did_from_result);IV(effective_f_test+anderson_rubin_ci);RDD(rdrobust+mccrary_test)。 - **Experiments:** randomization inference +
romano_wolffor multiple-outcome family-wise error rate control. - Sensitivity:
oster_delta/sensemakr。
Report in the main texteconomic magnitude, with the full battery in the appendix; every number must be reproducible. For an end-to-end actually-run example see
JF execution walkthrough. If StatsPAI/Stata is not connected, switch to resources/code/ and flag unverified numbers.
Must-check list
- Staggered DID: Bacon decomposition + at least one heterogeneity-robust estimator + event study plot
- Parallel trends / smoothness / weak instrument tests have all been done (not just looking at plots)
- Placebo tests (randomize treatment timing / randomize treated units)
- IV: KP rk F + effective F + AR robust confidence intervals + reduced form + three-part argument for exclusion
- RDD: report Robust row CI + rddensity manipulation test + multiple bandwidths
- Standard error clustering level is reasonable; wild bootstrap when few clusters
- Responded to the "treated units' anticipation / early response" problem
Anti-patterns
- TWFE + staggered but no discussion of heterogeneous treatment bias
- IV uses "exogenous event × previous-period endogenous variable"—reviewers will ask "why does the previous period not affect the current period"
- "We believe the policy is exogenous to firm decisions" but no evidence is given
- RDD uses a truncated bandwidth but does not report bandwidth sensitivity
- Treating the identification strategy as the selling point, divorced from theory and China's institutional issues
Output format
【识别策略】交叠DID / IV / RDD / DML / 结构估计 / 其他
【交叠DID 主估计量】TWFE only(需升级)/ CS / SA / BJS / dCDH
【已完成检验】[Bacon分解, 平行趋势, 安慰剂, KP F, 有效F, AR, rddensity, ...]
【缺失检验】[...]
【聚类层次】...
【下一步】er-mechanism