brycewang-stanford/StatsPAI
StatsPAI is the first Agent-native Python library for causal inference and applied econometrics — unified API, broad cross-method coverage, structured result objects, machine-readable schemas, Skills, an MCP server, and R/Stata parity validation.
What it solves
StatsPAI provides a unified Python-native API for applied causal inference and econometrics, acting as a practical replacement for researchers who typically switch between Stata, R, and Python. It eliminates the need to jump between different languages for loading datasets, estimating models, and exporting publication-ready tables.
How it works
It implements a broad suite of econometric routines (such as OLS, IV, high-dimensional fixed effects, staggered DiD, and synthetic control) with a focus on cross-language parity. The library includes a parity index to track numerical alignment with R and Stata references, and provides agent-facing metadata to help AI agents translate and execute workflows. It also features an interactive plot editor for Jupyter notebooks to simplify figure adjustments without requiring deep matplotlib knowledge.
Who it’s for
Empirical researchers and economists who want to move their causal inference workflows into a Python-first environment while maintaining the familiar commands and output formats of Stata and R.
Highlights
- Broad Toolset: Includes replacements for common routines like
regress,ivregress,reghdfe,csdid, andrdrobust. - Causal Inference Focus: Specialized support for staggered Difference-in-Differences (DiD), Regression Discontinuity (RD), and Synthetic Control methods.
- Publication-Ready Exports: Built-in exporters for Excel (
outreg2) and Word (modelsummary) to generate journal-style tables. - Parity Validation: A rigorous validation system that distinguishes between certified, validated, and API-stable functions based on numerical evidence.
- Agent-Ready: Designed to be used by AI agents through function schemas and result summaries (
to_agent_summary()).
Related
- Project
- Project
- Project
- Project
- Project