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.

Documentation

See the documentation for more information, at best.readthedocs.io.

Requirements

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:

smart_drug.png

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.5.4):

$ python --version
Python 3.5.6

Then install with Pip:

$ pip install best

Developer notes

Tests

Running the tests requires pytest:

$ 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

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

best-2.0.0.post0.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

best-2.0.0.post0-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

Details for the file best-2.0.0.post0.tar.gz.

File metadata

  • Download URL: best-2.0.0.post0.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.5.6

File hashes

Hashes for best-2.0.0.post0.tar.gz
Algorithm Hash digest
SHA256 17360a6cd4e8df2186f7674a88a0a162a68ba8af5d760b033d691128e01f0458
MD5 7a65bdf5bd50139495d275fc15a17f25
BLAKE2b-256 e6cf8d07c36cbcb23cd812b0ce446e5e1aea1f4175bd94cd0e8848416ac9177a

See more details on using hashes here.

File details

Details for the file best-2.0.0.post0-py3-none-any.whl.

File metadata

  • Download URL: best-2.0.0.post0-py3-none-any.whl
  • Upload date:
  • Size: 13.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.5.6

File hashes

Hashes for best-2.0.0.post0-py3-none-any.whl
Algorithm Hash digest
SHA256 d128be41a41c260fe1f6840a915247b6e3585de5b36c0150d886d56a167ebbd7
MD5 2434e668c7ea966efe3e8ed3cd3d2c00
BLAKE2b-256 4720c7ff7b7eb36624c5b2b10418a5d66f091a916b318fd6a3939ab22cfe7e5a

See more details on using hashes here.

Supported by

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