PyStatsV1 provides plain, transparent Python scripts that mirror classical R textbook analyses, making it easy for students, tutors, and practitioners to:
- run statistical analyses from the command line,
- generate synthetic data for teaching,
- produce figures and JSON summaries,
- and compare outputs across R/Python.
The project follows a chapter-based structure — each chapter includes a simulator, an analyzer, Makefile targets, and CI smoke tests.
PyStatsV1 is designed for:
- Students who want to run textbook-style analyses in real Python code.
- Instructors / TAs who need reproducible demos and synthetic data for lectures, labs, or assignments.
- Practitioners who prefer plain scripts and command-line tools over large frameworks.
- R users who want a clear, line-by-line bridge from R examples into Python.
macOS / Linux
python -m venv .venv && source .venv/bin/activate
python -m pip install -U pip
pip install -r requirements.txtWindows (Git Bash or PowerShell)
# Git Bash first; PowerShell as fallback
python -m venv .venv; source .venv/Scripts/activate 2>/dev/null || .venv\Scripts\Activate.ps1
python -m pip install -U pip
pip install -r requirements.txtpython -m scripts.ch01_introductionmake ch13-ci # tiny CI smoke
make ch13 # full demomake ch14-ci
make ch14make ch15-ci
make ch15For an overview of what each chapter contains:
- CHAPTERS.md — coverage, commands, and outputs
- ROADMAP.md — planned chapters (e.g., Ch16 Epidemiology RR)
PyStatsV1 is structured with a core set of documentation:
- CONTRIBUTING.md — environment setup, development workflow, Makefile usage, PR process.
- CODE_OF_CONDUCT.md — community expectations & enforcement.
- CHAPTERS.md — high-level description of all implemented chapters.
- ROADMAP.md — the future of the project: upcoming chapters & milestones.
- SECURITY.md — how to privately report vulnerabilities.
- SUPPORT.md — how to get help or ask questions.
- Case Study Template:
docs/case_study_template.md— structure for building new chapter teaching documentation.
If you want to contribute, start with CONTRIBUTING.md and check issues labeled
good first issue or help wanted.
Want to help but not sure where to start?
-
Browse issues labeled
good first issueorhelp wanted. -
Pick one small thing (typo, doc improvement, tiny refactor, or a missing test).
-
Fork & clone the repo.
-
Create and activate a virtual environment, then:
pip install -r requirements.txt make lint make test -
Make your change, and ensure
make lintandmake testboth pass. -
Open a Pull Request and briefly describe:
- what you changed,
- how you tested it,
- which chapter(s) it touches, if any.
Maintainer promise: we’ll give constructive feedback and help first-time contributors land their PRs.
High-level upcoming work (see ROADMAP.md for details):
- ✅ v0.17.0 — Onboarding and issue templates
- ⏳ Next steps:
- Additional regression chapters (logistic, Poisson, etc.)
- Power and sample size simulations
- Epidemiology-focused examples (risk ratios, odds ratios)
- More teaching case studies using
docs/case_study_template.md
If you’d like to champion a specific chapter or topic, open an issue and we can design it together.
From the project root:
make lint # ruff check
make test # pytestTo run chapter smoke tests:
make ch13-ci
make ch14-ci
make ch15-ciAll synthetic data is written to:
data/synthetic/outputs/<chapter>/
…and ignored by Git.
Every pull request should:
- pass
make lintandmake test, - avoid committing generated outputs,
- follow the structure described in CONTRIBUTING.md.
GitHub provides:
- 🐛 Bug report template
- 💡 Feature request template
- 📘 Good first issue template
- 🔀 Pull request template
If you believe you’ve found a security issue, do not open a public GitHub issue.
Follow the private disclosure process described in SECURITY.md.
-
Questions?
Open a GitHub issue with thequestionlabel. -
Using PyStatsV1 in a course?
We’d love to hear about it — open an issue titledCourse report: <institution>or mention it in your PR description. -
Feature ideas / chapter requests?
Open an issue with theenhancementorchapter-idealabel.
As the project grows, we plan to enable GitHub Discussions and possibly a lightweight chat space for instructors and contributors.
MIT © 2025 Nicholas Elliott Karlson