Skip to main content

[DEPRECATED] PyStataR has been superseded by StatsPAI (pip install statspai). All functionality has been migrated and extended; see https://github.com/brycewang-stanford/StatsPAI/blob/main/MIGRATION.md for the API mapping. This final release exists only to notify users of the migration.

Project description

PyStataR

PyPI Version Python Version License Status

🇬🇧 English · 🇨🇳 中文


⚠️ DEPRECATED — Superseded by StatsPAI (2026-04-14)

PyStataR is no longer maintained. All functionality has been migrated to the new package StatsPAI, which also extends its scope to a complete causal-inference and econometrics toolkit — 390+ functions covering classical econometrics, modern ML-based causal inference (DID, RDD, IV, DML, Causal Forest, Meta-Learners, TMLE, Neural Causal, Causal Discovery, Policy Learning, and more), plus publication-ready Excel / Word / LaTeX output and LLM-friendly workflows.

Migrate in 3 steps

pip install statspai
# Old (PyStataR)
from pystatar import pyegen, pywinsor2, pdtab, pyoutreg
pyegen.rowmean(df, ['x1', 'x2'])
pywinsor2.winsor2(df, ['wage'], cuts=(1, 99))
pdtab.tab2(df, 'x', 'y')
pyoutreg.outreg(model, 'out.xlsx')

# New (StatsPAI)
import statspai as sp
sp.rowmean(df, ['x1', 'x2'])
sp.winsor(df, ['wage'], cuts=(1, 99))
sp.tab(df, 'x', 'y')
sp.outreg2(model, filename='out.xlsx')

Full API mapping: see MIGRATION.md in this repository or the identical copy inside StatsPAI.

Promises to existing users

  • PyPI package preserved foreverpip install pystatar continues to work; existing versions will never be removed from PyPI.
  • GitHub repo preserved — this repository will be archived (read-only) but never deleted; all Issues, Stars, and citations remain intact.
  • No new features or bug fixes — please migrate to StatsPAI for ongoing updates.
  • Issues are frozen — new questions should be opened at StatsPAI/issues.

Why deprecated

PyStataR began as a Stata-to-Python bridge for the four most-used academic commands (egen, winsor2, tabulate, outreg2). Over time, the bigger vision became clear: build a Python-native, AI-era causal-inference toolbox rather than a Stata emulator. That package is StatsPAI. Running two packages in parallel only confuses users and doubles maintenance — so PyStataR's mission is being merged into StatsPAI, which does everything PyStataR did, and much more.

— Bryce Wang, 2026-04-14


Historical overview (for reference)

PyStataR was a unified interface to four mature Stata-equivalent PyPI packages:

Submodule Stata equivalent Purpose
pyegen egen Extended data generation: ranks, row statistics, group operations
pywinsor2 winsor2 Winsorizing / trimming at percentile or IQR cutoffs
pdtab tabulate One- and two-way cross-tabulation with statistical tests
pyoutreg outreg2 Publication-quality regression tables exported to Excel / Word

All four are fully covered — and substantially extended — in StatsPAI under the unified sp.* namespace.

Final version

  • v0.4.1 — adds the DeprecationWarning and migration notice.
  • v0.4.0 — last feature release, integrated pyoutreg.

Citation

If you used PyStataR in a publication, you may still cite the original repository; its GitHub URL and release history will remain available indefinitely. For new work, please cite StatsPAI instead.


License

MIT — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pystatar-0.4.2.tar.gz (13.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pystatar-0.4.2-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file pystatar-0.4.2.tar.gz.

File metadata

  • Download URL: pystatar-0.4.2.tar.gz
  • Upload date:
  • Size: 13.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for pystatar-0.4.2.tar.gz
Algorithm Hash digest
SHA256 c024b5602494877cc7fe1cb59d9916b1a33a1f72664dbcc6d6282a5e615ddb0d
MD5 7e1e32d663b874f1fe75f9f94db81859
BLAKE2b-256 71f0ad2f5c66d38fa34475caae354f6cbcac0bcbeaf13d1c20c1bd6c778d7000

See more details on using hashes here.

File details

Details for the file pystatar-0.4.2-py3-none-any.whl.

File metadata

  • Download URL: pystatar-0.4.2-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for pystatar-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 19992f637d94d552e2c0aa66dc244923c9bc146916b4388536f6aa021ed6fc2b
MD5 1ee8a93a2e9eeb70cfee609579ff45af
BLAKE2b-256 2f7d45671dcc192e88aa57a416f524197830f0093eee2824b6ea59e82fe7323e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page