Skip to main content

Bayesian estimation supersedes the t-test

Project description

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.


See the documentation for more information, at



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/ 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/

The documentation describes the API in detail.


Ensure your Python version is sufficiently up-to-date (at least 3.5.4):

$ python --version
Python 3.5.6

Then install with Pip:

$ pip install best

Developer notes


Running the tests requires pytest (pip install pytest), and then can be run with:

$ 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.


The documentation can be built with Sphinx:

$ cd docs
$ make html

Project details

Download files

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

Files for best, version 2.0.2
Filename, size File type Python version Upload date Hashes
Filename, size best-2.0.2-py3-none-any.whl (13.0 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size best-2.0.2.tar.gz (13.2 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page