DOI: https://doi.org/10.21105/joss.10604
تاريخ النشر: 2026-09-03
المؤلف: Biaoyue Wang وآخرون
الموضوع الرئيسي: تقنيات الاستدلال السببي المتقدمة
نظرة عامة
StatsPAI هو حزمة بايثون مفتوحة المصدر مصممة للاستدلال السببي والاقتصاد القياسي التطبيقي، حيث توفر واجهة موحدة للباحثين التجريبيين لتقدير، تشخيص، مقارنة، والإبلاغ عن نماذج إحصائية متنوعة. تشمل الحزمة مجموعة واسعة من المنهجيات، بما في ذلك نماذج الانحدار ونماذج اللوحات، المتغيرات الآلية، الفروق الحديثة في الفروق، انقطاع الانحدار، التحكم الاصطناعي، المطابقة، ومقدرات التعلم الآلي لتأثيرات العلاج المتغايرة. مع أكثر من 1,100 دالة مسجلة منظمة في أكثر من 80 وحدة فرعية، يسهل StatsPAI التشخيصات الشاملة، وفحوصات المتانة، والإبلاغ، وكل ذلك متاح من خلال عبارة استيراد واحدة (`import statspai as sp`).
ميزة بارزة في StatsPAI هي تصميمه الأصلي للوكيل، حيث تتضمن كل دالة مسجلة مخططًا يمكن قراءته آليًا يصف حججها ومخرجاتها. يسمح هذا الوصف المنظم للبيانات النموذجية لمساعدي البحث المدعومين بنماذج اللغة الكبيرة (LLM) باكتشاف المقدرات بكفاءة، وتقييم البدائل، وفهم الافتراضات المنهجية دون الحاجة إلى تحليل نص غير منظم. هذه القدرة تميز StatsPAI عن مكتبات المقدرات التقليدية. الشيفرة المصدرية متاحة للجمهور على GitHub ومؤرشفة على Zenodo (Wang & Rozelle, 2026).
نقاش
يسلط النقاش الضوء على الحاجة إلى حل برمجي متماسك في الاقتصاد القياسي التطبيقي، معالجًا تجزئة الأدوات الموجودة مثل Stata و R وحزم بايثون. بينما يقدم Stata سير عمل متكامل، فإنه يفتقر إلى واجهة قابلة للقراءة آليًا للتحليل المدعوم بالذكاء الاصطناعي. يوفر R حزم متخصصة لمختلف الطرق الاقتصادية، لكن هذه الحزم ليست موحدة، وتركز عروض بايثون، مثل DoWhy و EconML، على جوانب محددة من الاستدلال السببي دون تغطية سير العمل الاقتصادي بالكامل. يظهر StatsPAI كحل، مصمم لتوفير بيئة أصلية بايثون تدمج بين اتساع Stata وعمق منهجية R، مما يسهل مساحة عمل تجريبية متماسكة للباحثين.
يتم هيكلة StatsPAI حول عائلات الطرق وطبقة التسجيل، مما يسمح للمستخدمين بالوصول إلى مجموعة متنوعة من المقدرات من خلال واجهة نتائج مشتركة تبسط الانتقال بين الطرق الكلاسيكية وطرق التعلم الآلي. تعزز هذه الاختيار التصميمي القابلية للتكرار والتحقق من الصحة من خلال ضمان أن المقدرات تعيد مخرجات منظمة مع تقارير متسقة. تم بناء الحزمة على مكتبات بايثون المعروفة وتدعم وحدات تسريع اختيارية لتحسين الأداء. يبرز بيان تأثير البحث تحقق StatsPAI من خلال فحوصات التوافق عبر اللغات مع R و Stata، مما يظهر توافقًا عاليًا في المخرجات ويوفر مجموعات بيانات تعليمية معيارية للتطبيق العملي. الاستخدام المستمر لـ StatsPAI في الأبحاث الواقعية يبرز إمكانيته في تعزيز القابلية للتكرار والمقارنة في تقييم السياسات التطبيقية.
DOI: https://doi.org/10.21105/joss.10604
Publication Date: 2026-09-03
Author(s): Biaoyue Wang et al.
Primary Topic: Advanced Causal Inference Techniques
Overview
StatsPAI is an open-source Python package designed for causal inference and applied econometrics, providing a unified interface for empirical researchers to estimate, diagnose, compare, and report various statistical models. The package encompasses a wide range of methodologies, including regression and panel models, instrumental variables, modern difference-in-differences, regression discontinuity, synthetic control, matching, and machine-learning estimators for heterogeneous treatment effects. With over 1,100 registered functions organized into more than 80 submodules, StatsPAI facilitates comprehensive diagnostics, robustness checks, and reporting, all accessible through a single import statement (`import statspai as sp`).
A notable feature of StatsPAI is its agent-native design, where each registered function includes a machine-readable schema that describes its arguments and outputs. This structured metadata allows large language model (LLM)-driven research assistants to efficiently discover estimators, evaluate alternatives, and understand methodological assumptions without the need for parsing unstructured text. This capability sets StatsPAI apart from traditional estimator libraries. The source code is publicly available on GitHub and archived on Zenodo (Wang & Rozelle, 2026).
Discussion
The discussion highlights the need for a cohesive software solution in applied econometrics, addressing the fragmentation of existing tools like Stata, R, and Python packages. While Stata offers an integrated workflow, it lacks a machine-readable interface for AI-assisted analysis. R provides specialized packages for various econometric methods, but these are not unified, and Python’s offerings, such as DoWhy and EconML, focus on specific aspects of causal inference without covering the entire econometric workflow. StatsPAI emerges as a solution, designed to provide a Python-native environment that integrates the breadth of Stata and the methodological depth of R, facilitating a coherent empirical workspace for researchers.
StatsPAI is structured around method families and a registry layer, allowing users to access a variety of estimators through a shared result interface that simplifies the transition between classical and machine-learning methods. This design choice enhances reproducibility and validation by ensuring that estimators return structured outputs with consistent reporting. The package is built on established Python libraries and supports optional accelerator backends for performance improvements. The research impact statement emphasizes StatsPAI’s validation through cross-language parity checks with R and Stata, demonstrating high agreement in outputs and providing canonical teaching datasets for practical application. The ongoing use of StatsPAI in real-world research underscores its potential to enhance reproducibility and comparability in applied policy evaluation.
