基于 SOC 职业分类
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/ptreezh/sscisubagent-skills --skill did-analysis命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | did-analysis |
| description | 执行双重差分法(DID)因果推断分析,结合计量经济学理论、统计检验方法、政策评估实践和数据科学技术。包含实验设计、模型设定、因果估计、政策解释四个阶段。 |
| license | MIT |
| compatibility | Python 3.8+, pandas, numpy, scipy, statsmodels, matplotlib, seaborn |
| metadata | {"domain":"causal-inference","methodology":"difference-in-differences","complexity":"advanced","version":"2.0.0","integration_type":"theoretical_quantitative","author":"socienceAI.com","website":"http://agentpsy.com"} |
| allowed-tools | python bash read_file write_file task |
prompts/experimental-design.mdprompts/model-specification.mdprompts/causal-interpretation.mdprompts/policy-recommendation.mdscripts/did_estimator.pyscripts/parallel_trend.pyscripts/robustness_test.pyscripts/visualization.pyscripts/integrated_did.py# DID集成分析器的核心决策逻辑 - 五阶段研究流程
class IntegratedDIDAnalyzer:
def execute_analysis(self, data, policy_context):
# 阶段1: AI进行实验设计 (理论指导)
experimental_design = self.execute_experimental_design(policy_context)
# 阶段2: AI进行模型设定 (理论+方法)
model_specification = self.execute_model_specification(data, experimental_design)
# 阶段3: 脚本执行计量估计 (精确计算)
estimation_results = self.execute_did_estimation(data, model_specification)
# 阶段4: AI进行因果解释 (理论阐释)
causal_interpretation = self.execute_causal_interpretation(estimation_results, experimental_design)
# 阶段5: AI制定政策建议 (实践应用)
policy_recommendations = self.execute_policy_recommendation(causal_interpretation, policy_context)
return self.integrate_results(experimental_design, estimation_results, causal_interpretation, policy_recommendations)
experimental-design.mdmodel-specification.mdcausal-interpretation.mdpolicy-recommendation.mdAI任务: 加载experimental-design.md,进行深度政策机制分析
输出: 实验设计方案、组别选择、时间窗口设定
计量支持: 数据特征分析脚本提供数据描述
AI任务: 加载model-specification.md,设计DID模型框架
输出: 模型设定方案、内生性处理策略、异质性分析设计
计量支持: 计量理论基础和模型选择指导
AI任务: 决策调用哪些计量脚本 脚本执行:
did_estimator.py: 执行DID估计parallel_trend.py: 平行趋势检验robustness_test.py: 稳健性检验
输出: 精确的估计结果、统计检验、质量指标AI任务: 加载causal-interpretation.md,进行因果机制阐释
输出: 因果效应解释、理论意义、统计可靠性评估
计量支持: 估计结果提供解释基础
AI任务: 加载policy-recommendation.md,制定政策建议
输出: 政策建议、可行性分析、外推有效性评估
计量支持: 因果效应大小和政策含义
每个提示词文件都采用渐进式结构:
理论质量: 计量模型的理论一致性和识别策略有效性
统计质量: 平行趋势假设、统计显著性、估计精度
政策质量: 政策现实相关性、建议可行性、外推有效性 if not check_parallel_trend_assumption(did_results): quality_issues.append("平行趋势假设不满足")
if not assess_endogeneity_concerns(did_results): quality_issues.append("存在潜在内生性问题")
if not validate_robustness_results(did_results): quality_issues.append("稳健性检验未通过")
return quality_issues
## 开始使用
### 快速启动
```bash
# 进入技能目录
cd did-analysis/
# 运行集成分析
python scripts/integrated_did.py
prompts/experimental-design.md: 实验设计专家提示prompts/model-specification.md: 模型设定专家提示prompts/causal-interpretation.md: 因果解释专家提示prompts/policy-recommendation.md: 政策建议专家提示scripts/did_estimator.py: DID估计核心算法scripts/parallel_trend.py: 平行趋势检验scripts/robustness_test.py: 稳健性检验scripts/visualization.py: 数据可视化scripts/integrated_did.py: 集成分析引擎references/METHODOLOGY.md: DID方法论详解references/BEST_PRACTICES.md: 最佳实践指南references/COMMON_PITFALLS.md: 常见陷阱与避免assets/templates/: 数据模板和报告模板注意: AI负责理论思考和因果解释,脚本负责精确计量估计,通过智能决策引擎实现因果推断的科学性和政策相关性的统一。