BEST: Bayesian Estimation Supersedes the t-Test
Python implementation of a Bayesian model to replace t-tests with Bayesian estimation, following the idea described in the following publication:
John K. Kruschke. Bayesian estimation supersedes the t test. Journal of Experimental Psychology: General, 2013, v.142 (2), pp. 573-603. (doi: 10.1037/a0029146)
The package implements Bayesian estimation of the mean of one or two groups, and plotting functions for the posterior distributions of variables such as the effect size, group means and their difference.
Documentation
See the documentation for more information, at best.readthedocs.io.
Requirements
- Python ≧ 3.7
- SciPy
- Matplotlib (≧ 3.0.0) for plotting
- PyMC3
Examples
A complete analysis and plotting is done in just a few lines:
>>> best_out = best.analyze_two(group1_data, group2_data)
>>> fig = best.plot_all(best_out)
>>> fig.savefig('best_plots.pdf')
For example, the two-group analysis in examples/smart_drug.py produces the following output:
More detailed analysis of the same data can be found in the Jupyter notebook examples/Smart drug (comparison of two groups).ipynb.
An example single-group analysis can be found in examples/paired_samples.py.
The documentation describes the API in detail.
Installation
Ensure your Python version is sufficiently up-to-date (at least 3.7):
$ python --version
Python 3.7.12
Then install this package and its dependencies with PIP:
$ pip install best
Developer notes
Tests
Running the tests requires pytest (pip install pytest),
and then can be run with:
$ python -m pytest tests
The plotting tests only ensure that the plot_all function does not throw errors,
and the plots need manual verification at tests/data/plot_all_*.pdf.
Documentation
The documentation can be built with Sphinx:
$ cd docs
$ make html
Metadata
Release files for best 2.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| best-2.0.5.tar.gz | 13.4 kB | Without provenance | Details for best-2.0.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| best-2.0.5-py3-none-any.whl | Python 3 | none | any | Details for best-2.0.5-py3-none-any.whl |
Total release size: 26.8 kB
Release files / best-2.0.5.tar.gz
| Download URL | best-2.0.5.tar.gz |
|---|---|
| Size | 13.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3077b43667a24ac1048de526a3a1f6cc640146cf9477dbbc56aeec2d8d32700b
|
|
BLAKE2b-256 checksum How to use checksums |
dd4714e19527f2b592be3483a918c663a4d1219f13172c456de2cf3879a9f2a6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.5.0 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.10
|
Release files / best-2.0.5-py3-none-any.whl
| Download URL | best-2.0.5-py3-none-any.whl |
|---|---|
| Size | 13.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d5fff155b2b68dd62c253795dd7f633046e2529a52b2052babed6941e1d5a48d
|
|
BLAKE2b-256 checksum How to use checksums |
3020c146c408c2fb81d81f2c2f926672acf1490f847def800c2eebc39f5d3168
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.5.0 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.10
|
Security for best 2.0.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.