Stata is the working tool of academic economists, policy researchers, and the World Bank / IMF / central bank research departments. It is purpose-built for the kinds of analyses applied economists actually do — panel regressions, IV, fixed effects, survey data — with a stable, well-documented command syntax that hasn't changed much in 30 years.
Why Stata, in a Python world
Python and R have eaten most of the data-science world. Stata is the place that survives because: (1) it has by far the most-cited econometric routines (xtreg, ivreg2, reghdfe, esttab — all written by economists, for economists); (2) the help documentation is extraordinarily good; (3) the file format and command grammar haven't changed, so a do-file from 2005 still runs today; (4) regulators, ministries, and many academic journals expect Stata-compatible reproduction packages.
The four windows
- Command — type one command at a time, see the result
- Results — what's printed back
- Variables — the columns of the loaded dataset
- Properties — metadata on the selected variable
Always work in do-files
Typing commands into the Command window is fine for exploration but useless for serious work. A do-file is a text file (with .do extension) containing your commands. You execute it with `do filename.do`, and the analysis is reproducible. Every published paper that uses Stata ships a do-file.
* my_analysis.doset more off // don't pause outputcapture log close // close any open loglog using analysis.log, replace // start a new loguse bankrates.dta, clearsummarizelog close
Working directory
pwd // print working directorycd "C:/projects/banking" // change directory
The help system
help command-name opens the manual entry for that command. Stata's manuals are extraordinarily good — better than R's, better than Python's. When in doubt, help [whatever] is the first move.
Comments — three styles
* line comment (must start with *). // inline comment (after a command). /* ... */ multi-line. Use them generously: a future-you reading a do-file is the most common audience.
Exercise
Open a new do-file editor and write a comment line and a summarize command (no actual data needed yet).