Skip to main content

hypothetical - Hypothesis and Statistical Testing in Python

Build Status Build status Coverage Status Codacy Badge Dependencies Python versions

Python library for conducting hypothesis and other group comparison tests.

Installation

The best way to install hypothetical is through pip.

pip install hypothetical

For those interested, the most recent development version of the library can also be installed by cloning or downloading the repo.

git clone git@github.com:aschleg/hypothetical.git
cd hypothetical
python setup.py install

Available Methods

Analysis of Variance

  • One-way Analysis of Variance (ANOVA)
  • One-way Multivariate Analysis of Variance (MANOVA)
  • Chi-square test of independence
  • Fisher's Exact Test
  • McNemar's Test of paired nominal data
  • Cochran's Q test

Descriptive Statistics

  • Kurtosis
  • Skewness
  • Mean Absolute Deviation
  • Pearson Correlation
  • Spearman Correlation
  • Covariance
    • Several algorithms for computing the covariance and covariance matrix of sample data are available
  • Variance
    • Several algorithms are also available for computing variance.
  • Simulation of Correlation Matrices
    • Multiple simulation algorithms are available for generating correlation matrices.

Critical Value Tables and Lookup Functions

  • Chi-square statistic
  • r (one-sample runs test and Wald-Wolfowitz runs test) statistic
  • Mann-Whitney U-statistic
  • Wilcoxon Rank Sum W-statistic

Hypothesis Testing

  • Binomial Test
  • t-test
    • paired, one and two sample testing

Nonparametric Methods

  • Friedman's test for repeated measures
  • Kruskal-Wallis (nonparametric equivalent of one-way ANOVA)
  • Mann-Whitney (two sample nonparametric variant of t-test)
  • Mood's Median test
  • One-sample Runs Test
  • Wald-Wolfowitz Two-Sample Runs Test
  • Sign test of consistent differences between observation pairs
  • Wald-Wolfowitz Two-Sample Runs test
  • Wilcoxon Rank Sum Test (one sample nonparametric variant of paired and one-sample t-test)

Normality and Goodness-of-Fit Tests

  • Chi-square one-sample goodness-of-fit
  • Jarque-Bera test

Post-Hoc Analysis

  • Tukey's Honestly Significant Difference (HSD)
  • Games-Howell (nonparametric)

Helpful Functions

  • Add noise to a correlation or other matrix
  • Tie Correction for ranked variables
  • Contingency table marginal sums
  • Contingency table expected frequencies
  • Runs and count of runs

Goal

The goal of the hypothetical library is to help bridge the gap in statistics and hypothesis testing capabilities of Python closer to that of R. Python has absolutely come a long way with several popular and amazing libraries that contain a myriad of statistics functions and methods, such as numpy, pandas, and scipy; however, it is my humble opinion that there is still more that can be done to make Python an even better language for data and statistics computation. Thus, it is my hope with the hypothetical library to build on top of the wonderful Python packages listed earlier and create an easy-to-use, feature complete, statistics library. At the end of the day, if the library helps a user learn more about statistics or get the information they need in an easy way, then I consider that all the success I need!

Requirements

  • Python 3.5+
  • numpy>=1.13.0
  • numpy_indexed>=0.3.5
  • pandas>=0.22.0
  • scipy>=1.1.0
  • statsmodels>=0.9.0

License

MIT

Metadata

Release files for hypothetical 0.3.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 hypothetical 0.3.0
File Size Uploaded
hypothetical-0.3.0.tar.gz 74.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hypothetical 0.3.0
File Interpreter ABI Platform
hypothetical-0.3.0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 166.5 kB

Release files / hypothetical-0.3.0.tar.gz

Download URL hypothetical-0.3.0.tar.gz
Size 74.5 kB
Tags Source
SHA-256 checksum
How to use checksums
fb3903f315b78e2448107d59d446186ddef74c219c0026fad66dd50eac3ce5f3
BLAKE2b-256 checksum
How to use checksums
69741831229b81785874466c7e58a97e1c1862765f36a98293712c58a0a13c76
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.3

Release files / hypothetical-0.3.0-py2.py3-none-any.whl

Download URL hypothetical-0.3.0-py2.py3-none-any.whl
Size 91.9 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
6c9da8cbd0c835d7d7a8c1dda4d8611835c18e8603fbfde7bf3b852fe3d49389
BLAKE2b-256 checksum
How to use checksums
d1e69af6eee93ed6bb907b76a70189fda1ab3eeafc4281049f7e464f8d00158a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.3

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.1

2 release files

0.1.0

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