Stata Help
Practical notes for getting work done in Stata.
A compact collection of older explainers, refreshed as a cleaner directory for command lookups, data wrangling, programming patterns, and reference links.
. use project.dta, clear . describe . egen group_id = group(firm year)
Core Topics
Variables
Create, recode, label, and inspect variables without losing track of the dataset.
Open guide CleaningStrings
Handle text values, extract parts of strings, and prepare messy fields for analysis.
Open guide ReferenceData Types
Review storage types, display formats, and the practical differences between them.
Open guideData Tools
egen
Use extended generation functions for group summaries, identifiers, row totals, and more.
Open guide Structurereshape
Move data between wide and long layouts when the analysis wants a different shape.
Open section PatternsRegular Expressions
Find and transform structured text with pattern matching inside Stata.
Open guideProgramming
Loops
Repeat work across variables, values, or files with clearer and shorter do-files.
Open guide AutomationMacros
Store names, values, and reusable snippets so commands can adapt as your work grows.
Open guide CommandsCommand Sheet
Return to the broad list of common Stata commands and examples.
Open guide