pipeline
Classical end-to-end empirical analysis workflow in the traditional Python econometric stack — pandas + numpy + scipy +…
End-to-end data analysis workflow in R or Python — from exploration through regression to publication-ready tables and figures. Make sure to use this skill whenever the user wants to run any empirical analysis, write analysis code, or produce output from data. Triggers include:
Claude Code
$ npx -y skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill data-analysis --agent claude-code
Codex
$ npx skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill data-analysis -a codex -y
Cursor
$ npx skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill data-analysis -a cursor -y
Gemini CLI
$ npx skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill data-analysis -a gemini-cli -y
GitHub Copilot
$ npx skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill data-analysis -a github-copilot -y
OpenCode
$ npx skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill data-analysis -a opencode -y
Windsurf
$ npx skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill data-analysis -a windsurf -y
name: data-analysis description: >- End-to-end data analysis workflow in R or Python — from exploration through regression to publication-ready tables and figures. Make sure to use this skill whenever the user wants to run any empirical analysis, write analysis code, or produce output from data. Triggers include: "analyze this data", "run a regression", "write R code for this", "write Python code for this", "I have a dataset", "help me with this regression", "run a DiD", "run an RDD", "event study", "IV regression", "fit a model", "produce a table", "make a figure", "explore my data", or any request involving a dataset path or empirical estimation. argument-hint: "[dataset path or description of analysis goal]" allowed-tools: ["Read", "Grep", "Glob", "Write", "Edit", "Bash", "Task", "AskUserQuestion"]
Run an end-to-end data analysis in R or Python: load, explore, analyze, and produce publication-ready output.
**Input:** `$ARGUMENTS` — a dataset path (e.g., `data/county_panel.csv`) or a description of the analysis goal (e.g., "regress wages on education with state fixed effects using CPS data").
---
Determine language from `$ARGUMENTS` or ask the user:
---
1. Create R script with proper header (title, author, purpose, inputs, outputs) 2. Load required packages at top (`library()`, never `require()`) 3. Set seed once at top: `set.seed(42)` 4. Create output directories: `dir.create("output/analysis", recursive = TRUE, showWarnings = FALSE)` 5. Load and inspect the dataset
**Tables:** `modelsummary` (preferred) or `stargazer` — export `.tex` and `.html` **Figures:** `ggplot2` with project theme; explicit `ggsave(width = X, height = Y)`; save as `.pdf` and `.png`; add `bg = "transparent"` only if output is for Beamer slides
1. `saveRDS()` for all key objects 2. Run the `r-reviewer` agent: *"Review the script at scripts/R/[script_name].R"* 3. Address Critical and High issues before presenting results
# ============================================================
# [Descriptive Title]
# Author: [from project context]
# Purpose: [What this script does]
# Inputs: [Data files]
# Outputs: [Figures, tables, RDS files]
# ============================================================
# 0. Setup ----
library(tidyverse)
library(fixest)
library(modelsummary)
set.seed(42)
dir.create("output/analysis", recursive = TRUE, showWarnings = FALSE)
# 1. Data Loading ----
# 2. Exploratory Analysis ----
# 3. Main Analysis ----
# 4. Tables and Figures ----
# 5. Export -------
1. Create Python script with header (title, author, purpose, inputs, outputs) 2. Import all packages at the top of the file 3. Set seeds: `np.random.seed(42)` and `random.seed(42)` 4. Create output directories: `Path("output/analysis").mkdir(parents=True, exist_ok=True)` 5. Load and inspect the dataset with `pandas`
**Tables:** Format with `pandas` and export via `.to_latex()` or `stargazer` (Python port) **Figures:** `matplotlib`/`seaborn`; explicit `fig.savefig(path, dpi=300, bbox_inches="tight")`; save as `.pdf` and `.png`
1. `joblib.dump(model, "output/model.pkl")` for fitted models 2. `df_results.to_parquet("output/results.parquet")` for DataFrames 3. Review the script manually against the Python checklist bel
## 🔥 力荐 · StatsPAI — Stata 与 R 的 Python 平替,为 AI Agent 而生 🔁 Stata / R 平替:reghdfe、csdid、rdrobust、synth、fixest、did 等常用命令在 Python 中一站式替代,一个 import statspai as sp 搞定 DID / RD / IV / SCM / DML / matching 🤖 面向 Agent 设计:结构化结果对象 + 内置 MCP Server,Claude / Codex
Classical end-to-end empirical analysis workflow in the traditional Python econometric stack — pandas + numpy + scipy +…
Use when the user asks to run a full empirical / causal analysis in Python — by default in the style of an applied economics…
Classical end-to-end empirical analysis workflow in the traditional Python econometric stack — pandas + numpy + scipy +…
Classical end-to-end empirical analysis workflow in the traditional Stata ecosystem — native Stata + reghdfe + ivreg2 + csdid +…
Classical end-to-end empirical analysis workflow in the modern tidyverse + econometrics R ecosystem — dplyr + tidyr + haven +…
Systematic writing framework for philosophy and interdisciplinary academic papers from optimized outline to submission-ready…
Direct browser control via CDP for web interaction: automation, scraping, testing, screenshots, and site/app work. Also covers…
Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling…