StatsPAI

StatsPAI is an Agent-native Python library for causal inference and applied econometrics — unified API, broad cross-method coverage, structured result objects,

What is StatsPAI?

StatsPAI is an 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.

Overview of StatsPAI

What it is

StatsPAI is an Agent-native Python library for causal inference and applied econometrics. It provides a unified API across a broad range of estimators, structured result objects, machine-readable schemas, an MCP server, and R/Stata parity validation. It is designed to let empirical researchers use Stata and R workflows natively in Python.

Key features

  • Unified API with methods mirroring Stata (e.g., regress, ivregress, reghdfe, csdid, rdrobust, synth, psmatch2, esttab) and R (e.g., lm, fixest, did, rdrobust, Synth, DoubleML, MatchIt, modelsummary).
  • Stata-style conventions for standard errors (vce=, robust=, cluster-variable inline) and small-sample factors.
  • Post-estimation methods: .summary(), .tidy(), .plot(), .to_latex(), .to_docx(), .to_agent_summary().
  • Agent-native access with machine-readable schemas (sp.list_functions(), sp.describe_function(), sp.function_schema()) and a bundled statspai-mcp server.
  • Companion tooling for Stata translation and cross-checking, plus skill repos for empirical research workflows.
  • Every public function carries a validation_status indicating certified/validated evidence versus API-stable breadth.

Use cases

Applied causal inference and econometric modeling in Python, including ordinary least squares (OLS), instrumental variables, high-dimensional fixed effects, staggered difference-in-differences, regression discontinuity, synthetic control, propensity score matching, double machine learning, and publication-ready table export.

Getting started

bash pip install statspai Python 3.10 – 3.13 on Linux and macOS. Optional extras include plotting (statspai[plotting]), fixest wrappers (statspai[fixest]), Bayesian estimators (statspai[bayes]), neural causal models (statspai[neural]), accelerated backends (statspai[performance]), Rust kernels (statspai[rust]), and spatial weights (statspai[spatial]).

License and pricing

License: MIT. Pricing: open source.

Based on the project's public README and repository metadata.

Add this badge to your README

Featured on YunoDB Badge styles & help

Maintain this project? Show that it is featured on YunoDB.

Markdown[![Featured on YunoDB](https://yunodb.com/badge/brycewang-stanfordstatspai.svg)](https://yunodb.com/tools/brycewang-stanfordstatspai?utm_source=github&utm_medium=badge)
HTML<a href="https://yunodb.com/tools/brycewang-stanfordstatspai?utm_source=github&utm_medium=badge"><img src="https://yunodb.com/badge/brycewang-stanfordstatspai.svg" alt="Featured on YunoDB" height="20"></a>