ワンクリックで
latex-table
LaTeX回归表格生成Skill。辅助生成符合AER/QJE等顶刊格式的三线表,包括标准误聚类标注、显著性星标、固定效应标注。触发词:LaTeX表格/回归表/三线表/table制作/latex table
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
LaTeX回归表格生成Skill。辅助生成符合AER/QJE等顶刊格式的三线表,包括标准误聚类标注、显著性星标、固定效应标注。触发词:LaTeX表格/回归表/三线表/table制作/latex table
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 | latex-table |
| description | LaTeX回归表格生成Skill。辅助生成符合AER/QJE等顶刊格式的三线表,包括标准误聚类标注、显著性星标、固定效应标注。触发词:LaTeX表格/回归表/三线表/table制作/latex table |
| version | 1.0 |
| metadata | {"openclaw":{"emoji":"📋","homepage":"https://github.com/SiyaoZheng/ai4ss-skills"}} |
本 Skill 辅助生成符合**经济学顶刊(AER, QJE, Econometrica, JPE)**格式规范的 LaTeX 回归表格。涵盖:标准三线表、面板数据固定效应表、工具变量表、事件研究表。
顶刊表格的核心要素:
┌─────────────────────────────────────────────┐
│ 表头(表标题 + 注释信息) │
├─────────────────────────────────────────────┤
│ 列标签(列1 列2 列3) │
│ ────────────────────────────────────────── │ ← 第一道线(顶部)
│ 变量行(因变量、自变量、控制变量) │
│ ────────────────────────────────────────── │ ← 第二道线(列分隔)
│ 统计量行(N、R²、F、聚类标准误) │
├─────────────────────────────────────────────┤
│ 表底注释(显著性标注、数据来源、稳健性说明) │
└─────────────────────────────────────────────┘
| 符号 | p值 | 说明 |
|---|---|---|
| *** | p < 0.001 | 1% 显著性 |
| ** | p < 0.01 | 5% 显著性 |
| * | p < 0.05 | 10% 显著性 |
| † | p < 0.10 | 15% 显著性(部分期刊) |
⚠️ 注意:不同期刊对星标的数量和阈值要求不同,投稿前需确认目标期刊格式。
\begin{table}[htbp]
\centering
\caption{基准回归结果}
\label{tab:baseline}
\begin{threeparttable}
\begin{tabular}{l*{3}{c}}
\toprule
& \multicolumn{3}{c}{因变量: log(GDP per capita)} \\
\cmidrule(l){2-4}
& (1) & (2) & (3) \\
\midrule
互联网普及率 & 0.023*** & 0.018** & 0.015* \\
& (0.007) & (0.008) & (0.008) \\
控制变量 & 否 & 是 & 是 \\
固定效应 & 否 & 否 & 年份+国家\\
\midrule
观测值 & 1,240 & 1,240 & 1,240 \\
R² & 0.041 & 0.315 & 0.682 \\
\bottomrule
\end{tabular}
\begin{tablenotes}
\item \textit{注:} ***, **, * 分别表示1\%, 5\%, 10\%的显著性水平。括号内为聚类标准误(聚类在国家层面)。控制变量包括:教育年限、人口增长率、贸易开放度。
\end{tablenotes}
\end{threeparttable}
\end{table}
\begin{table}[htbp]
\centering
\caption{固定效应模型估计结果}
\label{tab:fe}
\begin{threeparttable}
\begin{tabular}{l*{4}{c}}
\toprule
& \multicolumn{2}{c}{OLS} & \multicolumn{2}{c}{固定效应} \\
\cmidrule(l){2-3} \cmidrule(l){4-5}
& (1) & (2) & (3) & (4) \\
\midrule
技术扩散指数 & 0.035*** & 0.028** & 0.021* & 0.018* \\
& (0.009) & (0.010) & (0.011) & (0.010) \\
\midrule
国家固定效应 & \checkmark & \checkmark & \checkmark & \checkmark \\
年份固定效应 & & \checkmark & & \checkmark \\
\midrule
观测值 & 1,240 & 1,240 & 1,240 & 1,240 \\
R² & 0.31 & 0.45 & 0.72 & 0.78 \\
\bottomrule
\end{tabular}
\begin{tablenotes}
\item \textit{注:} 同上。固定效应模型使用双向聚类标准误(国家+年份)。
\end{tablenotes}
\end{threeparttable}
\end{table}
\begin{table}[htbp]
\centering
\caption{工具变量估计结果}
\label{tab:iv}
\begin{threeparttable}
\begin{tabular}{l*{3}{c}}
\toprule
& OLS & \multicolumn{2}{c}{2SLS} \\
\cmidrule(l){2-2} \cmidrule(l){3-4}
& (1) & (2) & (3) \\
\midrule
技术扩散指数 & 0.023*** & 0.041*** & 0.038*** \\
& (0.007) & (0.013) & (0.012) \\
\midrule
KP F统计量 & & 24.6 & 28.3 \\
弱工具变量检验 & & & \\
\midrule
观测值 & 1,240 & 1,240 & 1,240 \\
\bottomrule
\end{tabular}
\begin{tablenotes}
\item \textit{注:} 列(2)-(3)使用技术扩散的滞后值作为工具变量。KP F统计量>10通过弱工具变量检验。
\end{tablenotes}
\end{threeparttable}
\end{table}
// 安装 estout 套件
ssc install estout, replace
// 保存回归结果
eststo clear
eststo: reg ln_gdp internet i.year, vce(cluster country)
eststo: reg ln_gdp internet cov1 cov2 i.year, vce(cluster country)
// 导出 LaTeX
esttab using "tables/table1.tex", replace ///
title("基准回归结果") ///
label ///
booktabs ///
nonumbers ///
mtitles("OLS" "OLS") ///
star(* 0.05 ** 0.01 *** 0.001) ///
se ///
r2 ///
addn("控制变量包括教育年限、人口增长率、贸易开放度。")
import pandas as pd
from scipy.stats import ttest_ind
# 使用 statsmodels 输出的 LaTeX 转换
from statsmodels.iolib.summary import summary_table
# 回归后
result = model.fit()
print(result.summary_latex())
| 要求 | 说明 |
|---|---|
| Threeparttable | 使用 \begin{threeparttable} 环境 |
| booktabs | 使用 \toprule, \midrule, \bottomrule |
| 字体 | 通常10pt,表的注释可9pt |
| 列宽 | 使用 p{3cm} 控制列宽,或 tabularx 自动调整 |
| 数字对齐 | 数字右对齐,变量名列左对齐 |
| 缺失值 | 表格中用空白表示缺失,不写"NA" |
## 表格输出规范
**输出路径**:tables/table{N}.tex
**主子表规范**:
- 主表(Main):表格1-3,放入正文
- 附录表(Appendix):表格A1-A10,放入Online Appendix
**文件名规范**:
tables/table1_baseline.tex # 基准回归 tables/table2_heterogeneity.tex # 异质性分析 tables/tableA1_robustness_iv.tex # 附录:IV稳健性
**LaTeX 代码规范**:
- 表格必须可编译(无缺失 `}` 或 `{`)
- 所有特殊字符(%, &, #)需转义
在 Claude Code 对话窗口输入:
/latex-table
或完整 Prompt:
按LaTeX表格Skill生成符合AER顶刊格式的三线表回归结果,包括:基准回归表(表1)、固定效应表(表2)、工具变量表(表3)。使用booktabs环境,包含标准误聚类标注、显著性星标、固定效应标注。
did-reviewer → DID 回归结果使用事件研究表格式R-optimizer → R 输出表格时的优化codebook-pass → 清洗后数据直接用于表格生成