Created
May 12, 2022 21:30
-
-
Save rtkilian/1d2d5ab2ac763556b4f499a4ba997a3b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from scipy.stats import mannwhitneyu | |
# Randomly generate the data | |
x1 = rng.normal(loc=0.25, scale=1, size=100) | |
x2 = rng.normal(loc=0.00, scale=1, size=100) | |
# Calculate test statistic and p-value | |
stat, p = mannwhitneyu(x1, x2) | |
# Interpreatation | |
print('stat=%.3f, p=%.3f' % (stat, p)) | |
if p > 0.05: | |
print('Do not reject the null hypothesis and conclude the distributions of the samples are the same.') | |
else: | |
print('Reject the null hypothesis and conclude the distributions of the samples are not the same.') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment