A Python package for creating publication-ready tables from regression results, descriptive statistics, and balance tables with output to LaTeX, Word, Typst, and HTML (HTML tables are created with Great Tables).
Overview
MakeTables provides a unified interface for generating tables such as:
The package supports multiple output formats including:
Great Tables (HTML)
LaTeX
Microsoft Word (docx) documents
Typst
NoteFeedback Welcome
Bug reports and feature requests through GitHub Issues are highly welcome.
Origin
MakeTables originated as the table output functionality within the PyFixest package and has been moved to this standalone package to provide broader table creation capabilities and support other statistical packages.
import pandas as pdimport maketables as mtimport pyfixest as pf# Load your data (here using a sample Stata dataset with the import_dta function that also stores variable labels)df = mt.import_dta("data/auto.dta")# Create descriptive statistics tablemt.DTable(df, vars=["mpg","weight","length"], bycol=["foreign"])
Domestic
Foreign
N
Mean
Std. Dev.
N
Mean
Std. Dev.
Mileage (mpg)
52.00
19.83
4.74
22.00
24.77
6.61
Weight (lbs.)
52.00
3,317.12
695.36
22.00
2,315.91
433.00
Length (in.)
52.00
196.13
20.05
22.00
168.55
13.68
# Fit your models (here using pyfixest)est1 = pf.feols("mpg ~ weight", data=df)est2 = pf.feols("mpg ~ weight + length", data=df)# Make a regression tablemt.ETable([est1, est2])
Mileage (mpg)
(1)
(2)
coef
Weight (lbs.)
-0.006*** (0.001)
-0.004** (0.002)
Length (in.)
-0.080 (0.055)
Intercept
39.440*** (1.614)
47.885*** (6.088)
stats
Observations
74
74
R2
0.652
0.661
Significance levels: * p < 0.1, ** p < 0.05, *** p < 0.01. Format of coefficient cell: Coefficient (Std. Error)