v0.5.0: Agent-Native Architecture + 80 New APIs
StatsPAI v0.5.0 — Agent-Native Causal Inference Toolkit
Highlights
- 284 exported functions (up from 205 in v0.4.0)
- Agent-native design:
list_functions(),describe_function(),function_schema()for LLM-driven workflows - 32 new files, 18K+ new lines of code
New Modules
Stata-Level Post-Estimation (Python first)
estat()— 14 unified diagnostics (BP, White, RESET, VIF, DW, BG, IC, linktest, normality, leverage...)esttab()/eststo()— Stata-style model comparison tables (text/LaTeX/HTML/Markdown/Word/Excel)regtable()— unified regression tables with multi-panel supportmargins_at(),contrast(),pwcompare()— predictive margins and pairwise comparisonsoaxaca(),gelbach()— Oaxaca-Blinder and Gelbach decompositionstepwise(),lasso_select()— variable selection with AIC/BICmean_comparison()— balance/comparison tables with t-tests
Cutting-Edge DID Methods (Python zero → full coverage)
did_multiplegt()— de Chaisemartin & D'Haultfoeuille (2020)did_imputation()— Borusyak, Jaravel & Spiess (2024)stacked_did()— Cengiz, Dube, Lindner & Zipperer (2019)wooldridge_did()— Wooldridge (2021) extended TWFEdrdid()— Sant'Anna & Zhao (2020) doubly robust DIDcic()— Changes-in-Changes (Athey & Imbens, 2006)twfe_decomposition()— Bacon + dCDH weight diagnosticspretrends_test(),pretrends_power()— Roth (2022)sensitivity_rr()— Rambachan & Roth (2023) honest DID
Inference & Standard Errors
romano_wolf()— Romano-Wolf multiple hypothesis testingtwoway_cluster()— Cameron-Gelbach-Miller two-way clusteringconley()— Conley spatial HAC standard errorsjackknife_se(),cr2_se()— small-cluster inferencewild_cluster_boot()— wild cluster bootstrapfisher_exact()— randomization inference with Hodges-Lehmann CIpate()— external validity / PATE estimationssaggregate(),shift_share_se()— Adão et al. (2019) shift-share corrections
RD Extensions
rkd()— Regression Kink Design (Card et al., 2015)rd_honest()— Armstrong-Kolesár honest confidence intervalsrdit()— Regression Discontinuity in Time
Quantile & Distribution Methods
qdid(),qte()— quantile treatment effectsnotch()— bunching at notches (Kleven & Waseem, 2013)
Diagnostics & Bounds
kitagawa_test()— LATE validity testhorowitz_manski(),iv_bounds(),oster_delta(),selection_bounds(),breakdown_frontier()propensity_score(),overlap_plot(),love_plot(),ps_balance(),trimming()
Power Analysis (Python ecosystem gap filled)
power()— unified power for DID, RD, IV, cluster RCT, OLSmde()— minimum detectable effect
Data Generating Processes
- 10 ready-made DGPs:
dgp_did,dgp_rd,dgp_iv,dgp_rct,dgp_panel,dgp_observational,dgp_cluster_rct,dgp_bunching,dgp_synth,dgp_bartik
CI/CD
- All 884 tests passing
- flake8 clean (0 critical errors)
- Full 3-OS × 4-Python matrix green