Created
October 2, 2019 09:16
-
-
Save lylayang/271a1a2906cbe85db1a9ff9ef2efdeb7 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
import numpy as np | |
from scipy.stats import mannwhitneyu | |
sample1=[32, 34, 29, 39, 38, 37, 38, 36, 30, 26] | |
sample2=[40, 34, 30, 39, 38, 37, 38, 36, 50, 49] | |
stat, pvalue=mannwhitneyu(sample1, sample2) | |
print('statistics=%.3f, p=%.5f'%(stat,pvalue)) | |
alpha=0.05 | |
if pvalue> alpha: | |
print('Two Groups are from the Same distribution(fail to reject H0) under alpha=0.05') | |
else: | |
print('Two Groups are from Different distributions(reject H0) under alpha=0.05') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment