*! version 1.0.0 12jan2026

Title

outreg2e -- outreg2 with direct HTML/Markdown table export

Syntax

outreg2e [varlist] [estlist]
using filename
[, options]

Options

Main
replace overwrite existing file

append append to existing file

html output in HTML format

md output in Markdown format

tex output in LaTeX format

word output in Word format

excel output in Excel format

title(text) add a title above the table

ctitle(text) add column title

dec(#) decimal places for coefficients

bdec(#) decimal places for coefficients (specific)

tdec(#) decimal places for t-stats/SE

rdec(#) decimal places for R-squared

alpha(...) significance levels and asterisks

ishere display an iframe snippet for quick embedding after HTML export

isheretext(text) display custom text after the iframe snippet

Description

outreg2e is based on outreg2 (outreg2.ado) and keeps the original table-building behavior.

Its main extension is direct HTML/Markdown table output for web/markdown workflows. In other words, outreg2e is intended as a lightweight extension of outreg2, adding HTML/Markdown export while preserving familiar syntax.

Detailed Options

replace overwrites the filename if it exists.

append adds a new column to the existing table in filename.

html outputs the table in HTML format, suitable for web embedding or further conversion.

md outputs the table in Markdown format, which can be directly used in markdown editors, GitHub, or converted to other formats using tools like pandoc.

tex, word, excel specify the output format. outreg2e defaults to text if unspecified.

title(text) specifies a title for the table.

dec(#) and other formatting options behave identically to outreg2.

ishere prints an iframe HTML snippet to the Results window after file export. This helps embed the generated HTML table quickly in an ishere/tohtml workflow.

isheretext(text) prints custom text after the iframe snippet. It is usually used with ishere.

Remarks

When using outreg2e with the html option for Markdown reporting, it is highly recommended to follow the command with cmdcell out.
This ensures that the table embedding code is placed outside of Stata code blocks, allowing the table to render correctly in the browser.

Examples

1. Basic Regression Table to Markdown

Run a regression and output to a Markdown file:

. sysuse auto, clear

. regress price mpg weight

. outreg2e using "regtable", replace md title("OLS Regression Results") dec(3)

2. Basic Regression Table to HTML

Run detailed regressions and output to an HTML file for a report:

. sysuse auto, clear

. regress price mpg weight

. outreg2e using "regtable", replace html title("OLS Regression Results") sec dec(3)

4. Multiple Models in LaTeX

Compare two models in a LaTeX table:

. regress price mpg

. outreg2e using "models.tex", replace tex title("Model Comparison") ct("Model 1")

. regress price mpg weight foreign

. outreg2e using "models.tex", append tex ct("Model 2")

5. Workflow with Stored Estimates

Store models first, then output all at once (efficient):

. regress price mpg

. estimates store m1

. regress price mpg i.foreign

. estimates store m2

. outreg2e [m1 m2] using "allmodels.html", replace html title("Combined Results")

Author

Kerry Du

School of Management

Xiamen University

kerrydu@xmu.edu.cn

Huanyu Jia

School of Business

Zhengzhou University

jiahuanyu@zzu.edu.cn

Based on outreg2 by Roy Wada (roywada@hotmail.com).

Enhanced for markdown workflows, and supports HTML file export.