Skip to main content

StatisticsForScientists

StatisticsForScientists is a small Python project plus companion paper "From Estimands to Inference: A Practical Tutorial for Robust Statistical Analysis in Scientific Papers" for teaching practical statistical inference with an estimand-first perspective.

The repository includes:

  • inferential_stats.py: the main lightweight analysis module
  • examples.py: reproducible worked examples used in the paper
  • tests/: unit tests for the statistical helpers and reporting functions
  • latex/estimands_to_inference_tutorial.tex: the source of the tutorial paper
  • latex/estimands_to_inference_tutorial.pdf: the compiled PDF version of the paper

Disclaimer: It's a Work In Progress!

It's a new project I've been working on in my spare time; there are still many concepts that need to be presented. For example, paired/repeated-measures analyses, regression, contingency tables, ANOVA / mixed models, etc.

Paper

The tutorial manuscript is available here:

Installation

Create or activate your environment, then install the required dependencies:

pip install -r requirements.txt

Run The Examples

The paper's worked examples are implemented in examples.py. Please refer to this file for guidalines on how to use module inferential_stats.py.

python3 examples.py

Useful options:

  • python examples.py --show-data prints the raw datasets used in the paper
  • python examples.py --json emits machine-readable results for all worked examples

Run The Tests

python3 -m unittest discover -s tests

Rebuild The Paper

From the latex/ directory:

pdflatex -interaction=nonstopmode -halt-on-error estimands_to_inference_tutorial.tex
bibtex estimands_to_inference_tutorial
pdflatex -interaction=nonstopmode -halt-on-error estimands_to_inference_tutorial.tex
pdflatex -interaction=nonstopmode -halt-on-error estimands_to_inference_tutorial.tex

This produces latex/estimands_to_inference_tutorial.pdf.

Acknowledgments

My warmest thanks to Josh Starmer, the author of StatQuest YouTube channel and Tang et al., the authors of the paper Misuse, Misreporting, Misinterpretation of Statistical Methods in Usable Privacy and Security Papers.

Your journey continues with these two resources.

Metadata

Release files for stats4science 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for stats4science 1.0.0
File Size Uploaded
stats4science-1.0.0.tar.gz 279.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for stats4science 1.0.0
File Interpreter ABI Platform
stats4science-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 290.7 kB

Release files / stats4science-1.0.0.tar.gz

Download URL stats4science-1.0.0.tar.gz
Size 279.4 kB
Tags Source
SHA-256 checksum
How to use checksums
4bb93b20306e6877be37c0822962fb2800684cb9003db70eac734296692bb1b0
BLAKE2b-256 checksum
How to use checksums
dc69aaac077570e406c0bb6b3c40b4ca04bcb60c9bb89b15fb154b8bf761228b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / stats4science-1.0.0-py3-none-any.whl

Download URL stats4science-1.0.0-py3-none-any.whl
Size 11.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bff378f31b7cbeb7e1667c8b6c501d1236c72581eea40348ef79d0bc68a0d667
BLAKE2b-256 checksum
How to use checksums
f7f8ec797c02cf971d058df368814f7c5d1ffc720440a243542bf0844acbdf01
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page