Skip to content

Commit b3c5fe4

Browse files
docs(readme): add causal inference coverage matrix + ecosystem stats page
Adds a 15-row coverage matrix at the top of README.md and README_CN.md positioning StatsPAI against Stata (official + SSC), R (CRAN), statsmodels+linearmodels, and DoubleML across the core causal-inference families (DiD, IV, RD, Synth, DML, TMLE, neural causal, discovery, Proximal, QTE, MR, Conformal, BCF, Spatial). New docs/stats.md carries the full 23-row matrix, cross-ecosystem LOC comparison (StatsPAI 188K vs statsmodels 382K vs Stata official 1.04M vs R ecosystem ~150M), per-module LOC/function breakdown for all 78 modules, and a reproduction recipe. mkdocs nav wires it in as a top-level "Ecosystem stats" entry. LOC numbers are measured 2026-04-21 on macOS arm64; SSC / CRAN / Bioconductor totals are flagged as estimates with sources. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 7502e6a commit b3c5fe4

4 files changed

Lines changed: 223 additions & 0 deletions

File tree

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,36 @@ StatsPAI is the **agent-native** Python package for causal inference and applied
1515

1616
It brings R's [Causal Inference Task View](https://cran.r-project.org/web/views/CausalInference.html) (fixest, did, rdrobust, gsynth, DoubleML, MatchIt, CausalImpact, ...) and Stata's core econometrics commands into a single, consistent Python API.
1717

18+
---
19+
20+
## 📊 Causal Inference Coverage at a Glance
21+
22+
StatsPAI's focus is **causal inference** — and on this axis we aim to be the most complete single package in any language. "Stata" = official + major SSC packages. "R" = CRAN. "sm+lm" = statsmodels + linearmodels.
23+
24+
| Method family | Stata | R | sm+lm | DoubleML | **StatsPAI** |
25+
| ------------------------------------------------------------- | :---: | :---: | :---: | :---: | :---: |
26+
| DiD — staggered (CS/SA/BJS/dCdH/Gardner/Wooldridge ET) + event-study + honest CIs | ⚠️ |||| 🏆 |
27+
| IV — classical (2SLS/LIML/GMM) + modern (Kernel IV / Deep IV / KAN-DeepIV) | ✅ classical only | ✅ classical only | ⚠️ classical | ⚠️ | 🏆 |
28+
| RD — CCT + 2D / boundary + multi-cutoff + honest CIs + ML-CATE (18+ estimators) | ⚠️ | ✅ (`rdrobust`) ||| 🏆 |
29+
| Synthetic Control — ADH / ASCM / gsynth / BSTS / Bayesian / PenSCM / FDID (20 methods) | ⚠️ | ⚠️ (7 pkgs) ||| 🏆 |
30+
| Double / Debiased ML ||||||
31+
| Meta-Learners (S/T/X/R/DR) + Causal Forest / GRF ||||||
32+
| TMLE / HAL-TMLE ||||||
33+
| Neural causal (TARNet / CFRNet / DragonNet) ||||| 🏆 |
34+
| Causal discovery (NOTEARS / PC / LiNGAM / GES) || ⚠️ ||| 🏆 |
35+
| Proximal CI (fortified / bidirectional / MTP / DNC) || ⚠️ ||| 🏆 |
36+
| QTE / distributional TE / CiC / dist-IV | ⚠️ | ⚠️ ||||
37+
| Mendelian randomization (IVW/Egger/median/mode/PRESSO/MVMR/BMA) ||||||
38+
| Conformal causal inference ||||| 🏆 |
39+
| Bayesian Causal Forest (BCF / ordinal / factor-exposure) || ⚠️ ||||
40+
| Spatial econometrics (weights → ESDA → ML/GMM → GWR/MGWR → panel) || ⚠️ (5 pkgs) ||| 🏆 |
41+
42+
**Legend**: 🏆 most complete across ecosystems · ✅ full coverage · ⚠️ partial / scattered / single algorithm · ❌ not available.
43+
44+
**StatsPAI at a glance**: 889 registered functions · 78 modules · 188,244 LOC (core) + 42,768 LOC (tests). For the full coverage matrix (23 method families), per-module breakdown, and cross-ecosystem line-count comparison — see [`docs/stats.md`](docs/stats.md).
45+
46+
---
47+
1848
**🎉 NEW in v1.5.0 — Interference / Conformal / Mendelian family consolidation**
1949

2050
StatsPAI 1.5.0 is a minor release bundling three concurrent improvements to the interference, conformal causal inference, and Mendelian Randomization families: full-family documentation guides, unified dispatchers matching the `sp.synth` / `sp.decompose` / `sp.dml` pattern, and a targeted correctness audit that fixed two silent-wrong-numbers issues.

README_CN.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,36 @@ StatsPAI 是一个**面向 AI Agent** 的 Python 因果推断与应用计量经
1515

1616
它将 R 的 [Causal Inference Task View](https://cran.r-project.org/web/views/CausalInference.html)(fixest、did、rdrobust、gsynth、DoubleML、MatchIt、CausalImpact、sfaR、lme4、oaxaca、ddecompose……)和 Stata 的核心计量命令(`frontier``xtfrontier``mixed``meglm``mixlogit``ivqreg`……),统一到一个一致的 Python API 中。
1717

18+
---
19+
20+
## 📊 因果推断覆盖一览
21+
22+
StatsPAI 聚焦**因果推断**——在这条主线上,我们的目标是成为任何语言里覆盖最完整的单个包。"Stata" = 官方 + 主要 SSC 包;"R" = CRAN;"sm+lm" = statsmodels + linearmodels。
23+
24+
| 方法家族 | Stata | R | sm+lm | DoubleML | **StatsPAI** |
25+
| ------------------------------------------------------------------------ | :---: | :---: | :---: | :---: | :---: |
26+
| DiD — 多期异质性(CS / SA / BJS / dCdH / Gardner / Wooldridge ET)+ 事件研究 + honest CIs | ⚠️ |||| 🏆 |
27+
| IV — 经典(2SLS/LIML/GMM)+ 现代(Kernel IV / Deep IV / KAN-DeepIV) | ✅ 仅经典 | ✅ 仅经典 | ⚠️ 仅经典 | ⚠️ | 🏆 |
28+
| RD — CCT + 2D / 边界 + 多断点 + honest CIs + ML-CATE(18+ 估计器) | ⚠️ | ✅ (`rdrobust`) ||| 🏆 |
29+
| 合成控制 — ADH / ASCM / gsynth / BSTS / Bayesian / PenSCM / FDID(20 种方法) | ⚠️ | ⚠️ (7 个包) ||| 🏆 |
30+
| Double / Debiased ML ||||||
31+
| Meta-Learners(S/T/X/R/DR)+ 因果森林 / GRF ||||||
32+
| TMLE / HAL-TMLE ||||||
33+
| 神经因果(TARNet / CFRNet / DragonNet) ||||| 🏆 |
34+
| 因果发现(NOTEARS / PC / LiNGAM / GES) || ⚠️ ||| 🏆 |
35+
| Proximal 因果推断(fortified / bidirectional / MTP / DNC) || ⚠️ ||| 🏆 |
36+
| QTE / 分布处理效应 / CiC / dist-IV | ⚠️ | ⚠️ ||||
37+
| Mendelian randomization(IVW/Egger/median/mode/PRESSO/MVMR/BMA) ||||||
38+
| Conformal 因果推断 ||||| 🏆 |
39+
| 贝叶斯因果森林(BCF / 有序 / 因子暴露) || ⚠️ ||||
40+
| 空间计量(权重 → ESDA → ML/GMM → GWR/MGWR → 面板) || ⚠️ (5 个包) ||| 🏆 |
41+
42+
**图例**:🏆 跨生态最完整 · ✅ 完整覆盖 · ⚠️ 部分 / 分散 / 单算法 · ❌ 无。
43+
44+
**StatsPAI 一句话概览**:889 个注册函数 · 78 个模块 · 188,244 行核心代码 + 42,768 行测试。完整覆盖矩阵(23 个方法家族)、按模块拆分、以及跨生态行数对比,详见 [`docs/stats.md`](docs/stats.md)
45+
46+
---
47+
1848
**🎉 v1.5.0 新版本 — Interference / Conformal / Mendelian 三家族合并升级**
1949

2050
StatsPAI 1.5.0 是 minor 版本,一次性完成 interference、conformal 因果推断、Mendelian 随机化三个家族的三项联动升级:完整家族文档指南、与 `sp.synth` / `sp.decompose` / `sp.dml` 同构的统一 dispatcher,以及一次针对性的正确性审计修掉两处"悄悄算错"。

0 commit comments

Comments
 (0)