Skip to content

Home

The complete Python toolkit for panel data econometrics.

CI codecov PyPI Python License: MIT Development Status PyPI Downloads

70+ econometric models | 50+ diagnostic tests | Interactive HTML reports | Google Colab tutorials


Quick Start

from panelbox import FixedEffects
model = FixedEffects("invest ~ value + capital", data, "firm", "year")
print(model.fit(cov_type="clustered").summary())
from panelbox.gmm import SystemGMM
model = SystemGMM("n ~ L.n + w + k", data, "id", "year",
                   gmm_instruments=["L.n"], iv_instruments=["w", "k"])
results = model.fit(two_step=True)
print(results.summary())  # Includes Hansen J, AR(1)/AR(2) tests
from panelbox.experiment import PanelExperiment
exp = PanelExperiment(data, "invest ~ value + capital", "firm", "year")
exp.fit_all_models(["pooled", "fe", "re"])
validation = exp.validate_model("fe")  # 15+ automatic tests
comparison = exp.compare_models(["pooled", "fe", "re"])
exp.save_master_report("analysis.html")  # Interactive HTML report

What's Inside

  • Static Models


    Pooled OLS, Fixed Effects, Random Effects, Between, First Difference

    User Guide

  • Dynamic GMM


    Arellano-Bond, Blundell-Bond, CUE-GMM, Bias-Corrected

    User Guide

  • Spatial Econometrics


    SAR, SEM, SDM, Dynamic Spatial, General Nesting Spatial

    User Guide

  • Stochastic Frontier


    Production/Cost frontiers, Four-Component (unique in Python), TFP

    User Guide

  • Quantile Regression


    Pooled, FE, Canay Two-Step, Location-Scale, Dynamic, Treatment Effects

    User Guide

  • Panel VAR


    VAR, VECM, Impulse Response, FEVD, Granger Causality, Forecasting

    User Guide

  • Discrete Choice


    Logit/Probit, FE Logit, RE Probit, Ordered, Multinomial, Dynamic

    User Guide

  • Count Data


    Poisson, PPML, Negative Binomial, Zero-Inflated

    User Guide

  • Censored & Selection


    Tobit, Honore, Panel Heckman (Wooldridge 1995)

    User Guide

  • Instrumental Variables


    Panel IV/2SLS with first-stage diagnostics

    User Guide

  • Standard Errors


    HC0-HC3, Clustered, Driscoll-Kraay, Newey-West, PCSE, Spatial HAC

    Inference Guide

  • 50+ Diagnostic Tests


    Specification, serial correlation, heteroskedasticity, unit root, cointegration

    Diagnostics Guide

  • Visualization & Reports


    35+ Plotly charts, HTML/LaTeX/Markdown reports, Master Reports

    Visualization Guide


PanelBox vs. Stata, R, and linearmodels

Feature PanelBox Stata R (plm/splm) linearmodels
Static Models (FE/RE) ✅ ✅ xtreg ✅ plm ✅
Difference GMM ✅ ✅ xtabond2 ✅ pgmm ✅
System GMM ✅ ✅ xtabond2 ✅ pgmm ✅
CUE-GMM ✅ ❌ ❌ ❌
Spatial Models (SAR/SEM/SDM) ✅ ✅ spxtregress ✅ splm ❌
Dynamic Spatial ✅ ❌ ❌ ❌
Four-Component SFA ✅ ❌ ❌ ❌
Quantile FE (Canay) ✅ ❌ ✅ quantreg ❌
Panel VAR/VECM ✅ ✅ pvar ✅ panelvar ❌
Interactive HTML Reports ✅ ❌ ❌ ❌
Experiment Pattern ✅ ❌ ❌ ❌
Google Colab Tutorials ✅ 100+ ❌ ❌ ❌

Installation

pip install panelbox

With optional extras:

pip install panelbox[dev]     # Development tools
pip install panelbox[docs]    # Documentation tools
pip install panelbox[test]    # Testing tools

See the Installation Guide for detailed instructions.


Explore by Topic

  • Getting Started


    Install and run your first model in 5 minutes

    Quick Start

  • User Guide


    Comprehensive guides for all 13 model families

    User Guide

  • Diagnostics


    50+ validation and diagnostic tests

    Diagnostics

  • Tutorials


    100+ interactive notebooks with Google Colab

    Tutorials

  • API Reference


    Complete technical reference for all classes and functions

    API Reference

  • Theory


    Mathematical foundations and econometric background

    Theory


Library Metrics

Metric Value
Lines of Code 127,309
Models 70+
Tests 3,986
Coverage 85-92%
Diagnostic Tests 50+
Interactive Charts 35+
Tutorial Notebooks 100+

Citation

If you use PanelBox in academic research, please cite:

@software{panelbox2026,
  title = {PanelBox: Panel Data Econometrics for Python},
  author = {PanelBox Development Team},
  year = {2026},
  url = {https://github.com/PanelBox-Econometrics-Model/panelbox},
  version = {1.0.0}
}

Design Philosophy

PanelBox is built on four principles:

  • Ease of Use -- R-style formulas and a pandas-friendly API let you go from data to results in three lines of code.
  • Academic Rigor -- Every estimator follows published econometrics papers and is cross-validated against Stata and R.
  • Performance -- Numba-optimized critical paths deliver up to 348x speedups on large panels.
  • Publication-Ready Output -- LaTeX tables, interactive HTML reports, and Plotly visualizations are built in, not bolted on.