StatsPAI: A Unified, Agent-Native Python Toolkit for Causal Inference and Applied Econometrics
StatsPAI: A Unified, Agent-Native Python Toolkit for Causal Inference and Applied Econometrics
StatsPAI is an open-source Python package for causal inference and applied econometrics. It gives empirical researchers a single interface for estimating, diagnosing, comparing, and reporting models that are otherwise spread across many specialized packages or proprietary statistical environments. A single import statspai as sp reaches estimators for the main families of applied work: regression and panel models, instrumental variables, the modern difference-in-differences and regression-discontinuity toolkits, synthetic control and matching, and machine-learning estimators of heterogeneous treatment effects. It also covers the diagnostics, robustness checks, and reporting that surround them. The full catalogue of more than 1,100 registered functions across more than 80 submodules is enumerated in the package documentation rather than here.
Results from the mature estimators share a common reporting surface, so the same calls produce a summary, a figure, a LaTeX or Word table, or a citation. StatsPAI is also agent-native. Every registered function exposes a machine-readable schema, a structured description of its arguments and outputs that a program can parse directly, together with structured failure metadata. Such schemas let large language model (LLM)-driven research assistants discover estimators, choose among alternatives, and surface a method’s assumptions without parsing free-form prose, the capability that most distinguishes StatsPAI from a conventional estimator
library. The source code is available at https://github.com/brycewang-stanford/StatsPAI and archived on Zenodo (Wang & Rozelle, 2026).