Regression
2026-02-2116 min read

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.

Sytra Team
Research Engineering Team, Sytra AI

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

  1. Install estout once and store models with eststo.
  2. Use esttab with explicit variable order, labels, and statistics.
  3. Export to .tex, .rtf, or .csv directly from Stata.
  4. 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.

esttab-model-store.do
stata
1clear all
2set obs 2000
3gen 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)
8
9capture which esttab
10if _rc ssc install estout
11
12eststo clear
13eststo m1: regress wage education
14eststo m2: regress wage education experience
15eststo m3: regress wage education experience i.year, vce(cluster firm_id)
16
17esttab m1 m2 m3, se star(* 0.10 ** 0.05 *** 0.01)
. esttab 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
--------------------------------------------
๐Ÿ’กStore once, export many
Keep estimation and export separate. With stored models, you can rerender tables in multiple formats without rerunning regressions.

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.

esttab-export.do
stata
1clear all
2set obs 2000
3gen 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)
8
9capture which esttab
10if _rc ssc install estout
11
12eststo clear
13eststo m1: regress wage education
14eststo m2: regress wage education experience
15eststo m3: regress wage education experience i.year, vce(cluster firm_id)
16
17esttab m1 m2 m3, se star(* 0.10 ** 0.05 *** 0.01)
18
19* ---- 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"))
21
22esttab m1 m2 m3 using "tables/wage_models.csv", replace se plain
23
24display "table export complete"
. display "table export complete"
table export complete
โš ๏ธVersion-lock estout
Table formatting can change across estout updates. Keep environment notes so coauthors reproduce identical outputs.

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`.

. esttab m1 m2 using "tables/main.tex", replace
command esttab is unrecognized
r(199);
This causes the error
wrong-way.do
stata
esttab m1 m2 using "tables/main.tex", replace
This is the fix
right-way.do
stata
ssc install estout
which esttab
esttab m1 m2 using "tables/main.tex", replace
error-fix.do
stata
1capture which esttab
2if _rc {
3 ssc install estout
4}
5which esttab
. which esttab
c: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 clear ; regress ... ; collect export filename, replace
collect layoutDefines table structure
collect styleApplies formatting rules
collect exportExports to DOCX, XLSX, HTML, and more
collect label levelsControls readable headers

How 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:

sytra-prompt.txt
bash
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.


Written by Sytra Team
Research Engineering Team, Sytra AI

We build practical, reproducible workflows for Stata and R teams working on real empirical research pipelines.

#Stata#esttab#LaTeX#Regression Tables

Enjoyed this article?