AI Methods
AI-assisted applied economics research. Each article ships with Python code and replication materials.
Build Your Own Tools: Tutorials
Articles that walk through building research tools, end-to-end. Each pairs with code in our GitHub or with live tools at Tools & Code. For the full sequence these methods follow, from the first literature scan to the replication package, see AI for Applied Researchers, our five-step Start Here guide.
Matching in Python: a balanced covariate table doesn't make the estimate valid
A propensity-score match can pass every balance check and still return the wrong number. Balance says the matched groups look alike on the covariates we observed; it does not say a comparable control existed.
Synthetic control in Python: read the pre-fit before the gap
A zero-error pre-treatment fit returns a clean gap of 6.1 against a planted effect of 6.0, and the same zero-error fit returns a wrong gap of 4.3 when no valid counterfactual exists. The pre-fit that is allowed to be large is the diagnostic to trust.
Regression discontinuity in Python: getting the effect at the cutoff right
A global polynomial fit returns a clean, plausible 1.8 where the effect planted at the cutoff is 0.75. A local fit recovers about 0.75. How to estimate a regression discontinuity in Python, and the confounder the local fit still cannot see.
How to tell whether a double machine learning estimate is right
Double machine learning in Python: why a naive plug-in reads a true effect of 1.0 as 0.55, how cross-fitting recovers 0.97, and the confounder it still cannot detect.
Using difference-in-differences in practice
When difference-in-differences is the right tool, the three assumptions stated as decisions, and the ways it breaks, each shown in a worked Too Early To Say case with open code. A decision table maps the situation to the estimator and the check that keeps it honest.
How instrumental variables help in causal inference: a 2SLS worked example in Python
Instrumental variables buy identification by trading one testable assumption for two, one of which can never be tested. A reproducible 2SLS walkthrough on the Mroz data: OLS returns 0.1075, IV returns 0.0614, and the first-stage F of 55.4 is what tells us the instrument is strong enough to trust.
When a policy reaches only a few units: rolling difference-in-differences (lwdid)
A new rolling difference-in-differences estimator (lwdid) gives credible effects from one treated unit and a few controls. With so few units the transformation choice drives the answer: the standard version can report twice the truth, and unit-specific detrending recovers it.
AI Econometrics: Using AI for Code, Not for Identification
An AI assistant can draft econometric code and run specifications in seconds. It cannot decide the estimand, argue the identification, or verify that the code computes what the design claims. Two worked cases show where that line falls.
How do we know an AI's estimator does what we meant?
Rebuilding an estimator from a paper or package, the code can run without error and still be wrong. A routine that catches it: name the low-visibility choices in a spec, plant a known truth in a simulation, and read the code against its source.
Logistic regression beats LLM readouts on survey prediction
On a real public-health prediction task, a plain logistic regression on seven demographic facts outpredicted a language-model activation pipeline built on the same facts, AUC 0.769 vs 0.747, and steering the model's internals changed nothing about the ranking while making the probabilities less trustworthy.
Steering vectors estimate an average regression gradient
Activation steering, the trick of adding a vector to a language model's internal activations, approximates an average regression gradient: the alignment in our data is directional, short of the criterion we wrote down in advance for calling the two identical. Once we see the connection, we can ask the classic estimation questions and get classic answers.
Prediction-powered inference corrects AI-imputed survey estimates
Treating AI-imputed survey responses as real observations can understate a prevalence estimate by a factor of three while reporting a tight confidence interval. A regression adjustment a decade older than the models lets the predictions sharpen the estimate without ever making it worse.
Well-Executed But Not Important: Reading Importance From the Published Record
An LLM classification of 2,493 health-economics articles to operationalize importance. Calibration is 35% of publications but 18% of citations; Identification carries a +91% premium and Reframing +126%, holding topic, journal, and year constant. Pairs with the journal-topic-shares replication repo.
Cycling Through Bad Ideas Faster: A Medicaid Branding Worked Example
A two-week solo cycle through three coding rules, a controls ladder, and a behavioral-mechanism test on state Medicaid program branding, ending at a bounded null after expansion-cohort fixed effects collapse a naive +22% headline. Companion to the meta-research piece above.
Claude Code Skills Get Stale. Audit Them Quarterly.
A repeatable audit so the skills, hooks, and memory entries we wrote for older models stop quietly shaping today's numbers.
A Pre-Analysis Plan for Your Coding Agent
A three-layer architecture, rule, gate, and verification, for keeping a reasoning agent disciplined when system prompts alone are not enough.
Building a Literature Surveillance System
Combining free tools (Google Scholar, Semantic Scholar) with an AI assistant that handles the glue: citation networks, source merging, and the quiet failures.
One Context File, Zero Re-Explanations
How we set up a CLAUDE.md context file so research context survives across sessions, and we stop re-explaining the same project every time.
From Methods Paragraph to Working Pipeline
Translating a methodology section into executable code with AI assistance, step by step.
47 Scripts to 15: Cleaning a Research Codebase
Using an AI assistant to refactor and consolidate a sprawling research codebase without losing the analytical thread.
6,613 Stores, $147, Zero Lost Data
Building resilient data pipelines that handle API failures, rate limits, and edge cases without losing rows.
400 Labels to 94% Accuracy
Building and validating a grocery store classifier through iterative labeling, with the loop documented end-to-end.
EBT Verification Methodology
Cross-validating SNAP retailer data against multiple authoritative sources, so the labels we trust have a paper trail.
How to Calculate 2.7M Transit Routes for Free
Step-by-step guide to r5py, GTFS data, and multimodal accessibility analysis at zero cost.
Most Recent
AI Econometrics: Using AI for Code, Not for Identification
An AI assistant can draft econometric code and run specifications in seconds. It cannot decide the estimand, argue the identification, or verify that the code computes what the design claims. Two worked cases show where that line falls.
How do we know an AI's estimator does what we meant?
Rebuilding an estimator from a paper or package, the code can run without error and still be wrong. A routine that catches it: name the low-visibility choices in a spec, plant a known truth in a simulation, and read the code against its source.
When a policy reaches only a few units: rolling difference-in-differences (lwdid)
A new rolling difference-in-differences estimator (lwdid) gives credible effects from one treated unit and a few controls. With so few units the transformation choice drives the answer: the standard version can report twice the truth, and unit-specific detrending recovers it.
Logistic regression beats LLM readouts on survey prediction
On a real public-health prediction task, a plain logistic regression on seven demographic facts outpredicted a language-model activation pipeline built on the same facts, AUC 0.769 vs 0.747, and steering the model's internals changed nothing about the ranking while making the probabilities less trustworthy.
Steering vectors estimate an average regression gradient
Activation steering, the trick of adding a vector to a language model's internal activations, approximates an average regression gradient: the alignment in our data is directional, short of the criterion we wrote down in advance for calling the two identical. Once we see the connection, we can ask the classic estimation questions and get classic answers.
Prediction-powered inference corrects AI-imputed survey estimates
Treating AI-imputed survey responses as real observations can understate a prevalence estimate by a factor of three while reporting a tight confidence interval. A regression adjustment a decade older than the models lets the predictions sharpen the estimate without ever making it worse.
Well-Executed But Not Important: Reading Importance From the Published Record
When AI thins out the technical-flaws desk-rejection pretext, editors will have to learn to say "well-executed but not important" on the record. We classify 2,493 articles across four health-economics journals to ask what "important" has actually meant.
Cycling Through Bad Ideas Faster: A Medicaid Branding Worked Example
What AI actually adds to solo research is fast iteration through ideas that turn out to be wrong, with new techniques sometimes emerging as byproducts of the failed attempts.
Claude Code Skills Get Stale. Audit Them Quarterly.
Every skill, hook, and memory entry written for an older model is a patch with an expiration date. In empirical research, the expired ones produce wrong numbers that look right and shape the policy decisions built on them.
What AI Impact Looks Like in the Slow Data
Usage telemetry sees AI adoption; slow public data sees household conditions. The same AI tooling can read both at the cadence either one needs.
A Pre-Analysis Plan for Your Coding Agent
A three-layer architecture for keeping reasoning agents disciplined: rule, gate, and verification. Trained priors beat system prompts, so reliable behavior redirection needs architecture, not instruction.
Building a Literature Surveillance System
Free tools like Google Scholar alerts and Semantic Scholar already monitor academic literature. What an AI coding assistant adds is the glue: combining sources, following citation networks, and catching the quiet failures that make AI-gathered references dangerous.
Browse all 71 methodology articles by category below.
Medicaid Fraud Detection
What 227 Million Rows of Medicaid Data Can and Can't Tell Us
The largest Medicaid dataset in history just went public. What it contains, what's missing, and why that matters for fraud screening.
The Label Problem: Why Fraud Labels Are Harder Than They Look
Exclusion lists are the closest thing we have to fraud labels. They are further from ground truth than most analysts assume.
What Billing Patterns Actually Look Like
Comparing excluded and non-excluded providers across billing volume, coding concentration, and temporal patterns.
Can a Classifier Find What Simpler Methods Miss?
Building a supervised fraud classifier with gradient boosting, SHAP interpretation, and honest temporal validation.
AI-Assisted Research
Well-Executed But Not Important: Reading Importance From the Published Record
An LLM classification of 2,493 health-economics articles to operationalize importance. Calibration is 35% of publications but 18% of citations; Identification carries a +91% premium and Reframing +126%, holding topic, journal, and year constant.
Cycling Through Bad Ideas Faster: A Medicaid Branding Worked Example
A two-week solo cycle through three coding rules, a controls ladder, and a behavioral-mechanism test, ending at a null. What AI compresses is the calendar time of discarding bad ideas.
One Context File, Zero Re-Explanations
How CLAUDE.md files maintain research context across sessions, eliminating repetitive explanations.
From Methods Paragraph to Working Pipeline
Translating a methodology section into executable code with AI assistance.
47 Scripts to 15: Cleaning a Research Codebase
Using AI to refactor and consolidate a sprawling research codebase.
Data Collection & Validation
6,613 Stores, $147, Zero Lost Data
Building resilient data pipelines that handle API failures, rate limits, and edge cases.
400 Labels to 94% Accuracy
Building and validating a grocery store classifier through iterative labeling.
EBT Verification Methodology
Cross-validating SNAP retailer data against multiple authoritative sources.
Spatial Analysis
More Methodology Articles
The rest of the library: the full set of AI-assisted research workflows, code tutorials, and method walkthroughs.
AI Research Workflows
Claude Code guides for academic research: CLAUDE.md context files, skills, hooks, MCP servers, context window management, and verification practices. From first session to personal AI infrastructure.
Building Our Research System: Putting It All Together
How CLAUDE.md, skills, hooks, and MCP servers combine into a personal research system that becomes more valuable over time. Part 5 of the Advanced Tier series.
Claude Code Guide
A comprehensive 14-article guide to mastering Claude Code. Learn context management, session workflows, agent spawning, and building personal AI infrastructure. Estimated 2-3 hours total reading time.
Your First Session: What Claude Code Is and Isn't
A practical walkthrough of what Claude Code can and cannot do, with prompting patterns and a complete first-task example.
A Starter Kit for the Economist's First Week in Claude Code
A starter kit for economists using Claude Code: one CLAUDE.md template, a verification checklist, three starter skills, and a week-one glossary.
The Cold Start Problem
Why the first five minutes of an AI session matter most, and how CLAUDE.md solves the context problem.
Why It Forgot Everything: Understanding Context
Understanding how AI context windows work, why sessions reset, and how to work with this fundamental limitation of large language models.
Context Window Budgeting
Treating tokens as a finite resource, and knowing when to spawn agents versus work directly.
Reading Our Analysis Files
How Claude Code explores research projects using three core tools: Read (look at a file), Glob (find files by pattern), and Grep (search inside files).
Research Phases Need Different Prompts
Exploration, implementation, and documentation require different AI prompting strategies. Match the prompt to the phase.
Creating Skills: Reusable Workflows for Research
Skills are recipe cards for research tasks. Write the steps once, save them in a file, and Claude Code follows those instructions whenever needed.
Hooks: Automation Without Asking
Hooks are automatic triggers that run without asking - like auto-save, but for research tasks. A power-user feature, entirely optional.
Connecting Claude to Outside Services: FRED, Census, and Beyond
How to connect Claude Code to external data sources like FRED, Census, and Google Scholar, bringing integrated research workflows into natural conversation.
Creating Helpers: When to Delegate Work
When to create separate Claude Code helpers for focused work, how to design tasks that are easy to hand off, and patterns for running multiple helpers at the same time.
What Agents Actually Do (And What They Don’t)
An agent is a specification-bounded process. Its output quality depends on prompt precision and project context, not hidden model capabilities.
What We Mistake for AI Capability
AI output quality tracks specification precision, not model capability. A task with wide tolerance makes the model look smart. Narrow tolerance reveals the gaps.
The Verification Tax
Every AI output needs checking. Building verification into workflow to catch hallucinations before they compound.
7 Copy-Paste Cycles to 1 Command: What Changes with Agent-Based Coding
The difference between chatbot-based coding and agent-based coding is categorical, not incremental. Here's what changes when AI can read your entire codebase.
End-of-Session Hygiene: What to Capture Before Context Resets
What to capture before context resets, and how five minutes of capture saves twenty minutes tomorrow.
Reading Your Own Data
How to interpret your Claude Code /insights report at beginner and intermediate levels - same data, different lessons.
Running Claude Code skills, for applied economists
A setup guide for the TETS Claude Code skills introduced in the tool series (papers-md-generator, replication-package-analytics, attribution-audit-network). What Claude Code is, what a skill is, how to…
Why Claude and ChatGPT Struggle with Research Graphics (And What Makes Antigravity Prompts Work)
When Claude and ChatGPT botch research figures, structured Antigravity prompts produce the publication-quality graphics we actually need.
Staging LinkedIn Posts with Browser Automation
A case study in form-filling workflows that keep humans in the loop. Browser automation handles navigation and data entry while the human retains final approval.
The Data We Forgot We Had: A Tagging System for Research Serendipity
Tag datasets by the questions they can answer, not just what they contain. A question-first system makes dormant research data discoverable when new questions arise.
Open-Source Methods
Python tutorials for applied economics: difference-in-differences, spatial joins, SHAP interpretation, GTFS validation, Census API pipelines, and imbalanced classification. All with replication code.
How to Estimate Difference-in-Differences in Python
A statsmodels workflow for event study estimation, with the diagnostics that separate credible estimates from noise.
How to Build a Classifier When 94% Accuracy Means Nothing
A scikit-learn workflow for imbalanced classification, with the evaluation metrics that actually matter.
How to Interpret a Classifier with SHAP Values
A Python workflow for understanding what drives model predictions, and what SHAP importance actually measures.
How to Build a Census Data Pipeline
A Python workflow for pulling ACS data from the Census API, including the validation checks that prevent bad data from reaching the analysis.
How to Validate GTFS Feeds Before They Break the Routing Engine
A Python workflow for catching the transit data problems that structural checks miss. Six validation layers from download fallbacks to multi-agency sanity checks.
A reference library for empirical methods
A Claude Code skill that turns a DOI or PDF into a structured papers.md block documenting the estimator, identification strategy, and named assumptions, with a misattribution flag when the bibliography credits…
A common shape for econ replication packages
A Claude Code skill that crawls econ replication packages and produces a panel dataset of 12 structural-compliance metrics per package. Descriptive measurement of what packages contain across openICPSR and the…
A field map for causal-inference methods
A Claude Code skill that builds a navigable citation network around a single method family, surfacing the seminal references, the current authors, the recent applications, and (as a bonus layer) papers that…
Attribution audit network
A navigable map of causal-inference method credit chains: who is credited for which idea, and where the literature gets it wrong.
Monitoring Government Data Portals
A case study in tracking California health data releases with Claude Code. Catch new data releases without manual checking across HCAI, DHCS, DOF, and other state agencies.
91% of "Grocery Stores" Aren't Really Groceries
How we classified 25,000 stores without setting foot in one—and what we found about food environment quality in California.
Spatial Analysis with GeoPandas: From Joins to Autocorrelation
A spatial analysis workflow that starts with point-to-polygon joins and builds toward spatial weights, autocorrelation testing, and LISA cluster detection using Python.
What Happens When You Measure Crime Where People Actually Live?
What happens when you swap county averages for neighborhood data? A 22-fold range in crime rates emerges.
Why County Rankings Confound Policy with Context
Merced County's vulnerability index is 2.3 times higher than San Francisco's. But before drawing policy conclusions, we need to understand what that number actually measures.
Scaling Up: From 7 Counties to Statewide
Expanding from 2,000 to 9,039 census tracts reveals what scales linearly (Census API, KD-trees) and what requires adaptation (transit aggregation, memory management). Here's what the statewide data shows that…
Understanding the Limits of Parallel Trends Tests
Why a high p-value on parallel trends tests can mislead, and how sensitivity analysis reveals fragile causal claims.
When the parallel-trends test fails on one lead, what's left?
Replicating Wang et al. (2026) TWFE-DiD on SNAP BBCE adoption from IPUMS ACS, with Goodman-Bacon decomposition and leave-one-out diagnostics.
Frequently Asked Questions
What is AI-assisted research?
AI-assisted research uses large language models like Claude to accelerate the translation of methodological expertise into working code. The researcher provides domain knowledge, variable definitions, and methodological decisions through context files (CLAUDE.md). The AI helps implement these ideas as code, identifies edge cases, and assists with refactoring. AI assistance doesn't replace expertise; it multiplies its impact. See our article on context files in research.
How do you calculate transit accessibility for free?
We use r5py, a Python library built on Conveyal's R5 routing engine. Combined with publicly available GTFS transit feeds, it can calculate millions of multimodal routes at zero cost. Our r5py tutorial walks through the complete process with working code examples.
How do you validate data quality?
We cross-validate against multiple authoritative sources. For grocery store data, we compared USDA Food Access Atlas listings against the official SNAP retailer database, California ABC license records, and manual verification. This iterative process, documented in our grocery store classifier article, achieved 94% accuracy through 400 hand-labeled examples.
Can I replicate your research?
Yes. Every article links to a public GitHub repository containing all data and code needed to reproduce the analysis. Our main replication repository contains 18 research projects with complete documentation.