Resources

Welcome to my Resources page. Here I share tools, guides, and workflows I've developed for economic research using AI-powered coding assistants. These resources are designed to help researchers automate data analysis, improve coding efficiency, and leverage large language models for research tasks.

1. Getting Started with Claude Code

What is Claude Code?

Claude Code is a command-line AI coding assistant built by Anthropic. It lets you interact with an AI directly in your terminal, making it especially powerful for researchers who spend time writing scripts, cleaning data, and running statistical analyses.

  • Why it's useful for economic research: Claude Code can read your data files, write Stata or R code, explain errors, and automate repetitive tasks — all without leaving your workflow.
  • Key capabilities: Data cleaning and wrangling, statistical analysis (OLS, IV, DiD, RDD), visualization, replication package preparation, and text analysis using LLMs.

Installation Guide

  1. Ensure you have Node.js 18+ installed (nodejs.org)
  2. Install Claude Code globally via npm:
npm install -g @anthropic-ai/claude-code
  1. Run claude in any project directory to start a session.
  2. On first run, authenticate with your Anthropic account.

Your First Project

A simple example: loading and describing a dataset in Stata.

$ cd my-research-project $ claude > Load the file data/household_survey.dta and give me summary statistics for income, age, and education. Then run a simple OLS regression of log income on years of schooling and age.

Claude Code will read your files, understand the context, write the Stata code, and explain the results — all in one conversation.

2. Claude Code for Economic Research

A. Data Management & Cleaning

  • Automated data cleaning pipelines for survey and administrative data
  • Handling missing values, outliers, and inconsistent coding
  • Merging datasets from multiple sources (ENAHO, INEI, World Bank)
  • Creating analysis-ready datasets with proper variable labels

B. Statistical Analysis

  • Running regressions: OLS, IV (2SLS), Difference-in-Differences, RDD
  • Generating publication-ready summary statistics tables
  • Robustness checks, specification curves, and sensitivity analyses
  • Working with panel data and high-dimensional fixed effects

C. Visualization & Tables

  • Publication-ready figures using ggplot2 or Stata's coefplot
  • Event study plots and coefficient plots
  • Regression tables in esttab / outreg2 style
  • Choropleth maps for spatial data (shapefiles, GADM)

D. Text Analysis & LLM Integration

  • Processing open-ended survey responses at scale
  • Classifying administrative text data (legal documents, policy texts)
  • Topic modeling and sentiment analysis
  • Calling OpenAI / Anthropic APIs from within Stata or Python scripts

E. Reproducible Research

  • Creating AEA-style replication packages
  • Documentation best practices and inline commenting
  • Version control with Git and GitHub
  • Automated testing and validation of do-files

3. Downloadable Skills & Agents

These Claude Code skills are .md files you place in your .claude/skills/ directory. Once installed, activate any skill by typing /skill-name in a Claude Code session.

Stata Regression Skill

Automate regression analysis with proper diagnostics, clustered standard errors, and publication-ready tables.

Download
Place the file in .claude/skills/. In Claude Code, type /stata-regression and describe your regression setup. The skill will generate Stata code with proper clustering, fixed effects, and esttab output.

R Econometrics Skill

Causal inference workflows including IV, DiD, and RDD using the fixest package for high-dimensional fixed effects.

Download
Place the file in .claude/skills/. Type /r-econometrics and specify your identification strategy. The skill generates R code using fixest, lfe, or rdrobust as appropriate.

Data Cleaning Agent

Automated data cleaning pipeline for survey and administrative data — handles missing values, outliers, and merges.

Download
Activate with /data-cleaning. Point it at your raw data files and describe the target analysis. It will produce a documented cleaning do-file or R script with a full data audit.

Literature Review Assistant

Organize research papers, extract key findings, and create synthesis tables for your literature review.

Download
Use /lit-review then paste or link a list of papers. The agent reads abstracts, extracts key findings, and outputs a structured synthesis table in Markdown or LaTeX.

Research Ideation Skill

Generate and refine research questions from a phenomenon, dataset, or policy change.

Download
Type /research-ideation and describe a policy, dataset, or empirical puzzle. The skill generates potential research questions, identification strategies, and relevant literature pointers.

Academic Paper Writer

Draft and structure economics papers with proper academic style for introduction, results, or conclusion sections.

Download
Activate with /academic-writer. Provide your results, identification strategy, and target journal. The skill drafts the section in AER/JPE style with proper economic writing conventions.

Replication Package Linter

Automated checking and validation of replication packages — ensures code runs and produces expected results.

Download
Use /replication-lint on your project directory. The agent checks file structure, verifies all referenced datasets exist, tests script execution order, and generates an AEA-compliant README.

4. Tutorials & Examples

Tutorial 1: Cleaning and Analyzing Household Survey Data

Step-by-step guide to importing raw ENAHO/ENNIV data, handling complex survey weights, recoding variables, and producing a clean analysis dataset ready for regression.

Tutorial 2: Running a Difference-in-Differences Analysis

Setting up panel data, testing parallel trends, specifying event-study regressions, and creating publication-ready coefficient plots with confidence intervals.

Tutorial 3: Creating Publication-Ready Figures

ggplot2 and Stata graph styling for academic journals — color schemes, font sizes, aspect ratios, and exporting at correct DPI.

Tutorial 4: Building a Research Pipeline

Organizing scripts from raw data to final tables, documenting intermediate outputs, and setting up a master do-file that runs the entire analysis end-to-end.

Tutorial 5: Using LLMs for Survey Categorization

Setting up Anthropic API access, writing prompts for open-ended response classification, validating outputs, and optimizing cost with prompt caching.

5. Best Practices

Prompt Engineering for Research Tasks

  • Be specific about context: Tell Claude Code which dataset, variables, and estimator you're using.
  • Iterate: Start with a simple specification and ask Claude to add complexity (clustering, FE, controls) step by step.
  • Show, don't just tell: Paste a few rows of your data or the output of describe so Claude understands the structure.

Reproducibility Checklist

  • All scripts run sequentially from a single master file
  • Random seeds are set for any stochastic procedures
  • Package/ado versions are documented
  • Raw data is preserved and never overwritten
  • All file paths are relative, not absolute
  • A clear README explains folder structure and how to replicate tables

Debugging Tips

  • Paste the full error message into Claude Code — it reads Stata error output accurately.
  • Ask Claude to explain what the error means before asking for a fix.
  • Run set trace on (Stata) or options(error = traceback) (R) and share the trace.