import pandas as pd
import maketables as mt
import 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("https://www.stata-press.com/data/r18/auto.dta")
# Create descriptive statistics table
mt.DTable(df, vars=["mpg","weight","length"], bycol=["foreign"])
# Fit your models (here using pyfixest)
est1 = pf.feols("mpg ~ weight", data=df)
est2 = pf.feols("mpg ~ weight + length", data=df)
# Make a regression table
mt.ETable([est1, est2])MakeTables
A Python package for creating publication-ready tables from regression results (statsmodels, pyfixest, linearmodels), descriptive statistics, and balance tables with output to LaTeX, Word, and HTML via Great Tables.
Overview
MakeTables provides a unified interface for generating tables such as:
- Regression tables from Statsmodels, PyFixest, Linearmodels and Stata
- Descriptive statistics
- Balance tables
The package supports multiple output formats including:
- Great Tables (HTML)
- LaTeX
- Microsoft Word (docx) documents
NoteDevelopment Status
MakeTables is in early stage development. Bug reports 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.
Installation
From PyPI
pip install maketablesDevelopment Installation
git clone https://github.com/dsliwka/maketables.git
cd maketables
pip install -e .Quick Example
Get Started
- Getting Started Guide - Interactive examples from the README