Export Regression Tables in Stata: esttab Tutorial with LaTeX, Word, and CSV
The most detailed esttab guide on the internet. Multi-model tables, custom stats, LaTeX with booktabs, Word output, and side-by-side comparison with outreg2.
Your regression ran fine, but formatting the table takes longer than the econometrics.
You will automate high-quality table exports with one reproducible do-file.
All examples tested in Stata 18 SE. Compatible with Stata 15+.
Quick Answer
- Install estout once and store models with eststo.
- Use esttab with explicit variable order, labels, and statistics.
- Export to .tex, .rtf, or .csv directly from Stata.
- Keep one table script for all draft updates.
Make Table Production Part of the Analysis Pipeline
Estimate models and store outputs consistently
Table automation starts with consistent model estimation blocks. If model names and variable ordering drift, table scripts become brittle.
Store models right after each regression so exported comparisons remain deterministic.
If you are extending this pipeline, also review How to Structure a Stata Project and How to Merge Datasets in Stata.
1clear all2set obs 20003gen firm_id = ceil(_n/10)4gen year = 2010 + mod(_n,10)5gen education = 8 + floor(runiform()*10)6gen experience = 20 + floor(runiform()*20)7gen wage = 12 + 0.9*education + 0.4*experience + rnormal(0,3)89capture which esttab10if _rc ssc install estout1112eststo clear13eststo m1: regress wage education14eststo m2: regress wage education experience15eststo m3: regress wage education experience i.year, vce(cluster firm_id)1617esttab m1 m2 m3, se star(* 0.10 ** 0.05 *** 0.01)--------------------------------------------
(1) (2) (3)
wage wage wage
--------------------------------------------
education 0.912*** 0.904*** 0.897***
(0.019) (0.017) (0.021)
experience 0.402*** 0.401***
(0.010) (0.013)
--------------------------------------------
N 2000 2000 2000
--------------------------------------------Export publication-ready tables to LaTeX and CSV
Explicit export settings reduce last-minute formatting work. Include labels, standard errors, and fixed effects indicators in table notes.
Use one do-file that writes every output format required by collaborators and journals.
1clear all2set obs 20003gen firm_id = ceil(_n/10)4gen year = 2010 + mod(_n,10)5gen education = 8 + floor(runiform()*10)6gen experience = 20 + floor(runiform()*20)7gen wage = 12 + 0.9*education + 0.4*experience + rnormal(0,3)89capture which esttab10if _rc ssc install estout1112eststo clear13eststo m1: regress wage education14eststo m2: regress wage education experience15eststo m3: regress wage education experience i.year, vce(cluster firm_id)1617esttab m1 m2 m3, se star(* 0.10 ** 0.05 *** 0.01)1819* ---- Section-specific continuation ----20esttab m1 m2 m3 using "tables/wage_models.tex", replace se label b(3) se(3) stats(N r2, fmt(0 3) labels("Observations" "R-squared"))2122esttab m1 m2 m3 using "tables/wage_models.csv", replace se plain2324display "table export complete"table export complete
Common Errors and Fixes
"command esttab is unrecognized"
esttab is user-written and not installed in the current Stata environment.
Install estout with SSC and verify command availability using `which esttab`.
command esttab is unrecognized r(199);
esttab m1 m2 using "tables/main.tex", replacessc install estoutwhich esttabesttab m1 m2 using "tables/main.tex", replace1capture which esttab2if _rc {3 ssc install estout4}5which esttabc:adopluseesttab.ado *! version 2.1.2
Command Reference
collect (official alternative)
Stata docs โOfficial Stata framework for collecting and exporting estimation results in flexible table layouts.
collect layoutDefines table structurecollect styleApplies formatting rulescollect exportExports to DOCX, XLSX, HTML, and morecollect label levelsControls readable headersHow Sytra Handles This
Sytra can generate full table-export pipelines including model storage, label formatting, and format-specific options for LaTeX and Word.
A direct natural-language prompt for this exact workflow:
Estimate three wage regressions with progressive controls, store models, and export one LaTeX and one CSV table with coefficient stars, clustered SEs, and N plus R-squared stats.Sytra catches these errors before you run.
Sytra can generate full table-export pipelines including model storage, label formatting, and format-specific options for LaTeX and Word.
Join the Waitlist โFAQ
Is esttab built into Stata?
No. esttab is part of estout from SSC, so install once with `ssc install estout` and version-lock in project setup.
How do I export multiple models in one table?
Store estimates with eststo and pass all model names to esttab with consistent order and statistic options.
Should I use collect instead of esttab?
collect is official and powerful in Stata 17+, while esttab remains common in legacy pipelines. Choose based on team standards and journal templates.
Related Guides
- Publication-Ready Tables in Stata: esttab, outreg2, and collect
- reghdfe in Stata: High-Dimensional Fixed Effects Made Simple
- Stata margins: Complete Guide to Marginal Effects with Interpretation
- Clustered Standard Errors in Stata: vce(cluster) Explained with Examples
- Explore the regression pillar page
- Open the full regression guide index
- Browse all Stata & R guides on the blog index
- Browse all Stata pillars
We build practical, reproducible workflows for Stata and R teams working on real empirical research pipelines.