/economic-research-skills:er-data-samplefrom economic-research-skills
Guides writing the data and sample section of economic research manuscripts, including database naming, variable definition tables, descriptive statistics, and auditable sample filtering trails.
Ships in economic-research-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
配套代码:
resources/code/stata/01_clean.do(清洗 + 筛选留痕)、resources/code/stata/02_descriptive.do(描述统计 + 变量表)。 样本筛选每一步须可在代码复现,呼应er-reproducibility。
「数据与样本」开头第一段约 200 字,固定四块:时间跨度 + 数据库(点名)+ 样本范围 + N;筛选标准;缩尾处理;多源合并键。模板:
本文使用 2008—2022 年中国 A 股上市公司年度数据,财务数据来自国泰安(CSMAR)
数据库,专利数据来自中国研究数据服务平台(CNRDS),城市层面变量取自《中国城市
统计年鉴》。样本筛选:(1)剔除金融业(证监会行业 J 门类);(2)剔除 ST、*ST 及
退市公司;(3)剔除核心变量缺失的观测;(4)剔除资产负债率大于 1 的异常样本。最终
得到 2,841 家公司、共 28,317 个公司—年度观测的非平衡面板。为消除极端值影响,对所有
连续变量在上下 1% 分位进行缩尾(winsorize)处理。多源数据以「股票代码 + 年份」为
键合并,公司与城市数据按公司注册城市代码匹配。
每个变量有且仅有一行;定义给计算公式而非文字描述;数据来源精确到数据库名。分四类排列:被解释变量 / 核心解释变量 / 控制变量 / 工具变量。
| 类别 | 变量 | 符号 | 定义(计算公式) | 数据来源 |
|---|---|---|---|---|
| 被解释变量 | 企业避税 | BTD | =(税前会计利润−应纳税所得额)/ 期末总资产 | CSMAR 财务报表 |
| 核心解释变量 | 税收执法强度 | Enforce | =实际税负−预期税负(行业—地区回归残差) | 全国税收调查 |
| 控制变量 | 企业规模 | Size | =ln(期末总资产) | CSMAR |
| 控制变量 | 资产负债率 | Lev | =总负债 / 总资产 | CSMAR |
| 工具变量 | 政策冲击 | IV_reform | =2002 年所得税分享改革后注册=1,否则=0 | 作者手工整理 |
=实际税负-预期税负,不写「反映税负偏差」这类描述。01_clean.do 的 gen 一一对应。报告均值 / 标准差 / 最小值 / p25 / 中位数 / p75 / 最大值 / N;连续变量为缩尾后数值;变量顺序与定义表完全一致(一一呼应)。
每一步筛选可追溯、可在代码复现,正文给「漏斗」式交代,代码留痕呼应 er-reproducibility:
* 01_clean.do —— 样本筛选漏斗,每步记录剩余观测数
use "$data/raw/csmar_firm.dta", clear
count // 原始:512,043
drop if inlist(ind_code,"J") // 剔除金融业
drop if st_flag==1 // 剔除 ST/*ST/退市
drop if missing(btd, enforce, size, lev) // 剔除核心变量缺失
drop if lev>1 & !missing(lev) // 剔除资不抵债异常
winsor2 btd enforce size lev, cuts(1 99) replace // 上下 1% 缩尾
count // 最终:28,317
01_clean.do 复现,每步剩余观测数留痕【数据说明段落】四块齐全 / 缺:[库点名 / N / 筛选 / 缩尾 / 合并键]
【数据库点名】具体(CSMAR / CNRDS / ...)/ 含糊待改:[...]
【变量定义表】公式化且四类分组 / 问题:[某变量用描述/缺来源/缺类别]
【描述统计】合规(缩尾后, 含分位数)/ 异常未解释:[变量]
【表—文呼应】一致 / 不一致:[顺序 or N 对不上]
【筛选留痕】漏斗可复现 / 不透明:[缺步骤]
【面板与匹配】非平衡/平衡 已交代 + 匹配率 X% / 缺
【质疑预防】度量依据 / 代表性 / 选择偏误:[已备 / 待补]
【下一步】数据与样本扎实 → er-identification 落识别策略与主回归
../er-reproducibility/SKILL.md — 清洗 / 筛选 / 缩尾的代码留痕与复现包../er-robustness/SKILL.md — 核心变量替代度量与样本敏感性../../resources/external_tools.md — CSMAR / Wind / CNRDS 等数据源速查What SKILL.md sets; muted values are Claude Code's defaults
18 skills in this plugin
/er-abstractUse when drafting or revising the 中文内容提要 (~300 字, official) or English 梗概/Summary for an 《经济研究》 manuscript. Enforces the five-sentence Chinese pattern, the five-element English Summary, and forbids empty-significance phrases. 本技能服务于《经济研究》(Economic Research Journal, ERJ)。/er-heterogeneityUse when designing or writing the heterogeneity section of an 《经济研究》 (Economic Research Journal) manuscript — choosing which dimensions to cut, justifying each cut theoretically, presenting subsample results with coefficient-difference tests, and wiring at least one dimension back to the mechanism story so heterogeneity doubles as mechanism evidence. 使用时机:主结果已稳健但只切了"东中西"一类单一维度、审稿人要求补做异质性、或切分维度缺乏理论指引时。/er-identificationUse when the empirical identification strategy is the bottleneck for an Economic-Research manuscript — quasi-experimental designs (DID, IV, RDD, DML, event study). Stress-tests the design against modern (2019-2024) estimators and reporting standards before drafting tables./er-introductionUse when drafting or revising the 引言 (introduction) of an 《经济研究》 manuscript — when the opening starts from a remote macro backdrop, when contributions read like "丰富了相关研究", or when the introduction fails to spoil the core finding. 本技能服务于《经济研究》(Economic Research Journal, ERJ)。/er-literature-reviewUse when drafting or revising the literature-review section for an Economic-Research manuscript, when the Chinese / English reference balance is off, or when canonical theory references are missing./er-mechanismUse when designing or writing the mechanism analysis for an Economic-Research empirical manuscript. Enforces the post-江艇(2022) paradigm — estimate D→M with the main identification strategy and argue M→Y from theory, instead of running mediation step-wise / Sobel tests.npx claudepluginhub brycewang-stanford/awesome-journal-skills --plugin economic-research-skillsOther plugins' skills for the same job