Start from a task¶
Each page answers one question in its first paragraph, then gives complete code on real data with the output it prints, the checks to run before reporting, and the Stata and R equivalents. The code on every page is run by the test suite, so the numbers shown are the numbers you will get.
| I want to… | Page |
|---|---|
| estimate a staggered difference-in-differences and an event study | Difference-in-differences in Python |
absorb unit and year fixed effects with clustered SEs (reghdfe, fixest) |
Fixed effects and HDFE |
| run 2SLS and check instrument strength | Instrumental variables and 2SLS |
| estimate a regression discontinuity with robust bias-corrected inference | Regression discontinuity |
export regression tables to Word, Excel or LaTeX (esttab, outreg2) |
Regression tables |
| move a Stata do-file workflow to Python | From Stata to Python |
| pick the right Python library for my analysis | Choosing a Python library |
| let Claude Code, Cursor or another agent run the analysis | AI agents and MCP |
For a broader map of research tasks to functions, see research tasks: where to start; for what each number has been checked against, see the evidence scorecard and the claims and evidence ledger.