원클릭으로
did-reviewer
双重差分(DID)实证审查Skill。做DID分析前必须检查平行趋势假设、画图可视化、报告违背情况。触发词:DID审查/双重差分检查/平行趋势/DiD reviewer/difference-in-differences
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
双重差分(DID)实证审查Skill。做DID分析前必须检查平行趋势假设、画图可视化、报告违背情况。触发词:DID审查/双重差分检查/平行趋势/DiD reviewer/difference-in-differences
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Route empirical-research requests through the Auto-Empirical Research Skills catalog when this whole repository is installed as one skill in Codex, CodeBuddy, Claude Code, or another IDE. Use to choose and load the right vendored AERS skill for causal inference, econometrics, replication, manuscript writing, citation checking, de-AIGC editing, or full empirical-paper workflows without reading the entire repository at once.
Classical end-to-end empirical analysis workflow in the traditional Python econometric stack — pandas + numpy + scipy + statsmodels + linearmodels + pyfixest + rdrobust + econml + causalml + matplotlib/seaborn. **Defaults to economics empirical-paper style** (AER / QJE / AEJ) — every run produces a publication-ready output set with a multi-column regression table (M1→M6 progressive controls/FE) as the centerpiece, plus Table 1 (descriptives), mechanism / heterogeneity / robustness tables, and event-study + coefficient + trend figures. Covers the full 8-step pipeline an applied economist or quantitative social scientist runs on every paper — (1) data cleaning, (2) variable construction & transformation, (3) descriptive statistics & Table 1, (4) statistical diagnostic tests, (5) baseline empirical modeling, (6) robustness battery, (7) further analysis (mechanism, heterogeneity, mediation, moderation), (8) publication-ready tables & figures. **Also covers two parallel domain modes that share the same 8-step scaf
Classical end-to-end empirical analysis workflow in the modern tidyverse + econometrics R ecosystem — dplyr + tidyr + haven + fixest + sandwich + lmtest + clubSandwich + AER + ivreg + did + bacondecomp + HonestDiD + eventstudyr + rdrobust + rddensity + Synth + gsynth + synthdid + MatchIt + WeightIt + cobalt + ebal + grf + DoubleML + mediation + marginaleffects + modelsummary + kableExtra + gt + ggplot2 + ggpubr + cowplot + binsreg. **Defaults to economics empirical-paper style** (AER / QJE / AEJ) — every run produces a publication-ready output set with a multi-column regression table (M1→M6 progressive controls/FE) as the centerpiece, plus Table 1 (descriptives), mechanism / heterogeneity / robustness tables, and event-study + coefficient + trend figures. Covers the full 8-step R pipeline an applied economist runs on every paper — (1) data import & cleaning (read_dta/read_csv, naniar, janitor, validate-merges), (2) variable construction (mutate/across/winsorize/group_by + lag/lead with dplyr), (3) descriptive
Classical end-to-end empirical analysis workflow in the traditional Stata ecosystem — native Stata + reghdfe + ivreg2 + csdid + did_imputation + eventstudyinteract + sdid + rdrobust + rddensity + synth + synth_runner + psmatch2 + teffects + ebalance + coefplot + esttab + asdoc + binscatter. **Defaults to economics empirical-paper style** (AER / QJE / AEJ) — every run produces a publication-ready output set with a multi-column regression table (M1→M6 progressive controls/FE) as the centerpiece, plus Table 1 (descriptives), mechanism / heterogeneity / robustness tables, and event-study + coefficient + trend figures. Covers the full 8-step Stata pipeline an applied economist runs on every paper — (1) data import & cleaning (use/import, destring, misstable, duplicates, merge assert), (2) variable construction (gen/egen/winsor2/xtile/xtset with L./F./D.), (3) descriptive statistics & Table 1 (tabstat/balancetable/asdoc), (4) classical diagnostic tests (sktest/swilk/hettest/imtest/xtserial/xttest3/vif/dfuller/kpss/
学术引用核查Skill。要求每条引用必须定位到PDF原页,区分直接引用/间接引用,找不到原文则标注"待核"。触发词:引用核查/检查引用/citation check/核实文献/引用 fidelity
调查数据清洗Skill。处理调查数据(CGSS/CHIP/CSS等)时的标准化清洗流程,包括缺失值处理、变量编码统一、数据异常值检测。触发词:数据清洗/调查数据/codebook/数据清洗流程/问卷数据处理
| name | did-reviewer |
| description | 双重差分(DID)实证审查Skill。做DID分析前必须检查平行趋势假设、画图可视化、报告违背情况。触发词:DID审查/双重差分检查/平行趋势/DiD reviewer/difference-in-differences |
| version | 1.0 |
| metadata | {"openclaw":{"emoji":"📊","homepage":"https://github.com/SiyaoZheng/ai4ss-skills"}} |
本 Skill 是 DID(双重差分)实证分析的强制检查清单,在执行 DID 分析前和分析后都必须按本 Skill 检查:平行趋势假设、可视化、违背报告、稳健性。不符合本 Skill 要求的 DID 分析不得发表。
DID 是识别因果的"近似实验",但前提是平行趋势假设成立。若该假设不成立,则 DID 估计量是有偏的,无论结果多么"显著"。
常见错误:
| 类型 | 命令 | 说明 |
|---|---|---|
| 标准 DID(2×2) | didYw 或手动回归 | 处理组vs对照组,一次政策 |
| 多时点 DID(Staggered DID) | did2/csdid | 不同单位政策时间不同 |
| 交错 DID(Event Study) | eventstudy | 事件前后动态效应 |
| 连续 DID(Continuous DID) | 断点回归变体 | 政策强度连续变化 |
必须执行:
事件研究图规范:
X轴:相对时间(政策前第k期到政策后第k期)
Y轴:处理效应系数
必须包含:置信区间(95%CI)、政策前期系数连线、政策后期系数
判断标准:
若发现以下违背情况,必须如实报告:
| 违背类型 | 描述 | 处理方式 |
|---|---|---|
| Anticipation Effects | 处理组在政策实施前就提前反应 | 将政策前期效应纳入模型 |
| Spillover Effects | 对照组受到处理组溢出效应 | 排除溢出污染样本 |
| Composition Effects | 处理组样本在政策后发生变化 | 记录并分析样本变化 |
| Parallel Trend Violation | 政策前期趋势不平行 | 改用合成控制法(SCM) |
报告格式:
## 平行趋势违背报告
**检验方法**:[描述使用的检验方法]
**违背情况**:[是/否存在违背]
- 若存在:描述违背类型、程度、可能影响
- 若不存在:说明检验结果
若使用多时点 DID / 交错处理,额外检查:
Callaway & Sant'Anna (2021) 检验:
# 使用 csdid 或 did2 包
csdid(lwage, id, time, gvar, control = "nevertreated")
Borusyak et al. (2024) 检验:
# 使用 did 包
did(yname, tname, idname, gname, xformla = ~X)
判断标准:
必须执行:
| 检验类型 | 做法 | 判断标准 |
|---|---|---|
| 时间安慰剂 | 假设政策提前2-3年 | 政策前期系数应不显著 |
| 随机处理组 | 随机抽取处理组 | 显著结果应<5% |
| 替换变量 | 用同期不相关变量替代因变量 | 应不显著 |
至少报告以下稳健性检验:
报告处理效应的异质性:
| 异质性维度 | 分组方式 |
|---|---|
| 地区 | 沿海vs内陆 |
| 企业规模 | 大vs小 |
| 行业 | 高技术vs低技术 |
| 时间 | 政策早期vs晚期 |
## DID 实证审查报告
**审查对象**:论文标题/研究问题
**使用的识别策略**:标准DID / 交错DID / 连续DID
**数据来源**:[数据库名称,附provenance]
### 审查结果
| 检查项 | 状态 | 说明 |
|--------|------|------|
| 平行趋势检验 | ✅/❌ | 检验方法和结果 |
| 事件研究图 | ✅/❌ | 是否规范 |
| 违背情况报告 | ✅/❌ | 是否如实报告 |
| 交错DID特殊检验 | ✅/❌ | 使用的方法 |
| 安慰剂检验 | ✅/❌ | 结果是否合理 |
| 稳健性检验 | ✅/❌ | 报告了哪些 |
| 异质性分析 | ✅/❌ | 分析内容 |
### 致命缺陷(如有)
[列出可能导致识别策略失效的致命问题]
### 建议修改
[针对性的修改建议]
在 Claude Code 对话窗口输入:
/did-reviewer
或完整 Prompt:
按DID审查Skill检查本项目的DID分析:必须包含平行趋势检验、事件研究图、违背情况报告、交错DID特殊检验、安慰剂检验、稳健性检验。输出结构化审查报告。
grillme → 选题时确定使用 DID 作为识别策略citation-fidelity → 引用 DID 相关方法论文献时核查准确性econ-reviewer → 完整论文审查时配合使用