Metadata-Version: 2.1
Name: permuted-brunnermunzel
Version: 0.0.2
Summary: Python implementation of the permuted brunner munzel
Home-page: https://github.com/MatthewCorney
Author: Matthew Corney
Author-email: Matthew Corney <matthew_corney@yahoo.co.uk>
License: MIT
Project-URL: Homepage, https://github.com/MatthewCorney/permuted_brunner_munzel
Project-URL: Bug Tracker, https://github.com/MatthewCorney/permuted_brunner_munzel
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE

# Introduction
This package is an implementation of the permuted version of the Brunner-Munzel test is a nonparametric test.
The Permuted Brunner-Munzel is best suited to cases where the number of observations in one of the groups is below 10 and
ideally above 7

This is a reimplementation of the R/Fortran implementation found here https://cran.r-project.org/web/packages/brunnermunzel/index.html . This is for cases where is it not possible or complicated to call R from python

# Dependencies
The function requires the following Python packages:

- numpy
- scipy
- math

# Usage
The function takes five input arguments, x, y, alternative, nan_policy, est, and force.

- x and y are lists of observations for the two samples to be tested.
- alternative specifies the alternative hypothesis to be tested, and can take one of the following values: "two_sided", "greater", or "less". Default is "two_sided".
- nan_policy specifies how to handle missing values in the input data, and can take one of the following values: "propagate", "raise", or "omit". Default is "propagate".
- est specifies the estimator of the difference of the location shifts of the two distributions, and can take one of the following values: "original" or "difference". Default is "original".
- force specifies whether to force the use of the permuted Brunner-Munzel test even in cases where the normal Brunner-Munzel test would be more appropriate. Default is False.

The function returns a tuple of two float values:

- The first value is the estimated location shift between the two distributions (i.e., the P-value).
- The second value is the P-value of the test.

# Example
```
pip install permuted_brunnermunzel
```

```
from permuted_brunnermunzel import permuted_brunnermunzel

x = [0, 0, 0, 1, 1, 1, 0]
y = [30, 20, 19, 18, 15, 10, ]

result = permuted_brunnermunzel(x, y, alternative="less", nan_policy="propagate", est="original", force=False)
print(result)
```

```
(0.8571428571428571, 0.0005827505827505828)
```
