Skip to main content

manly_randomization_test

B. F. J. Manly was a statistician who wrote several influential books and papers on multivariate statistical methods, biostatistics, and methods for randomization tests.

A randomization test is a type of non-parametric test that allows us to test hypotheses without requiring assumptions about the specific distribution of the data. It's also known as a permutation test or re-randomization test.

In the case of comparing means between two groups, a randomization test can be used in place of a traditional t-test when the assumptions of the t-test are not met (for example, if the data do not follow a normal distribution, or if the sample size is very small).

Here is an overview of how a randomization test between means is conducted:

Calculate the observed difference between the two group means. 
    This will serve as your test statistic.
Combine all the observations from both groups into a single group.
Randomly divide this combined group into two new groups, making sure the group sizes match the original group sizes.
Calculate the mean difference for these randomized groups.
Repeat steps 3-4 thousands of times, each time recording the calculated mean difference.
Count the number of times the absolute value of the randomized mean difference is greater than or equal to the absolute value of the observed mean difference. 
    This will give you the p-value, or the probability of observing a mean difference as extreme as, or more extreme than, the observed mean difference under the null hypothesis.

The null hypothesis for this test is that the group labels do not matter; in other words, there is no difference in means between the two groups. If the p-value is less than your predetermined significance level (often 0.05), you would reject the null hypothesis and conclude that there is a statistically significant difference in means between the two groups.

Usage

from manly_randomization_test import RandomizationTest

group1 = np.array([1, 2, 3, 4, 5])
group2 = np.array([2, 3, 4, 5, 6])

test = RandomizationTest(group1, group2)
p_value = test.test()

print('p-value:', p_value)

Metadata

Release files for manly-randomization-test 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for manly-randomization-test 0.0.1
File Size Uploaded
manly_randomization_test-0.0.1.tar.gz 8.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for manly-randomization-test 0.0.1
File Interpreter ABI Platform
manly_randomization_test-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 19.2 kB

Release files / manly_randomization_test-0.0.1.tar.gz

Download URL manly_randomization_test-0.0.1.tar.gz
Size 8.0 kB
Tags Source
SHA-256 checksum
How to use checksums
321aab2ce709a518410c011bf29c97415795bccc7e8ad6ebae8beb011d928fdf
BLAKE2b-256 checksum
How to use checksums
0111a871f1e592f0ea64efaaced794b9084fa6cf77e1d947bbaf25e3a59d28ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.11

Release files / manly_randomization_test-0.0.1-py3-none-any.whl

Download URL manly_randomization_test-0.0.1-py3-none-any.whl
Size 11.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b64152645916adde4d596a1fe74277a9b5ca363fee8694007cf72eb9380e69a0
BLAKE2b-256 checksum
How to use checksums
a26ae1c706e78cf764e702af49d6a056631a92522a84dce1cf21a2ac384d6bd3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.11

Release history Release notifications | RSS feed

This release

0.0.1 This release

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