0

I'm using SciPy to perform Wilcoxon test and Friedman test. For example, I have 3 groups of samples.

sample1 = [0.76623377, 0.77922078, 0.71428571, 0.63636364, 0.7012987,  0.66233766, 0.72727273, 0.67532468, 0.63157895, 0.77631579]    
sample2 = [0.80519481, 0.76623377, 0.71428571, 0.71428571, 0.71428571, 0.72727273, 0.85714286, 0.74025974, 0.67105263, 0.77631579]
sample3 = [0.85714286, 0.74025974, 0.68831169, 0.77922078, 0.74025974, 0.77922078,0.80519481, 0.7012987,  0.73684211, 0.76315789]

If I apply Wilcoxon test for sample 1 and sample 2, using:

from scipy.stats import wilcoxon
t_stat, p = wilcoxon(sample1, sample2)

I get the error:

sample 1 is unequal to sample 2.

If I apply Friedman test for all 3 samples, using:

from scipy.stats import friedmanchisquare
stat, `p = friedmanchisquare(sample1, sample2, sample3)

I get the accept: sample 1 = sample 2 = sample3

How is that possible? Any explanations?

Attach the python output here: enter image description here

Grayrigel
  • 3,474
  • 5
  • 14
  • 32
Helen
  • 1
  • 3
  • Are you sure? I have installed scipy in a fresh conda environment and I don't get any of those errors. Could you provide a complete example rather than snippets? I do get a warning about sample sizes being too small for normal approximation but that is all. – FiddleStix Sep 24 '20 at 13:42
  • Hi Thanks. It is strange. I attached my notebook output at the end of the original post (you need click the image link I think view it) – Helen Sep 24 '20 at 19:57

0 Answers0