Skip to content

v0.5.0: Agent-Native Architecture + 80 New APIs

Choose a tag to compare

@brycewang-stanford brycewang-stanford released this 05 Apr 20:33

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 support
  • margins_at(), contrast(), pwcompare() — predictive margins and pairwise comparisons
  • oaxaca(), gelbach() — Oaxaca-Blinder and Gelbach decomposition
  • stepwise(), lasso_select() — variable selection with AIC/BIC
  • mean_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 TWFE
  • drdid() — Sant'Anna & Zhao (2020) doubly robust DID
  • cic() — Changes-in-Changes (Athey & Imbens, 2006)
  • twfe_decomposition() — Bacon + dCDH weight diagnostics
  • pretrends_test(), pretrends_power() — Roth (2022)
  • sensitivity_rr() — Rambachan & Roth (2023) honest DID

Inference & Standard Errors

  • romano_wolf() — Romano-Wolf multiple hypothesis testing
  • twoway_cluster() — Cameron-Gelbach-Miller two-way clustering
  • conley() — Conley spatial HAC standard errors
  • jackknife_se(), cr2_se() — small-cluster inference
  • wild_cluster_boot() — wild cluster bootstrap
  • fisher_exact() — randomization inference with Hodges-Lehmann CI
  • pate() — external validity / PATE estimation
  • ssaggregate(), 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 intervals
  • rdit() — Regression Discontinuity in Time

Quantile & Distribution Methods

  • qdid(), qte() — quantile treatment effects
  • notch() — bunching at notches (Kleven & Waseem, 2013)

Diagnostics & Bounds

  • kitagawa_test() — LATE validity test
  • horowitz_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, OLS
  • mde() — 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