Why do I get different p-values when I’m using “Wilcoxon rank sum test” or “Kruskal-Wallis test” on two groups. Which test shoud I prefer?
[p_kruskal,t,stats] = kruskalwallis(X, gender);
[p_wilcoxon,h,stats] = ranksum(X (gender==1), X (gender==2));
I’d like to compare the distributions of this two groups using boxplot with the option of ‘notch’ on. Why even if the notches in the box plot overlap Wilcoxon suggest me that the medians of the two groups differ?
Best Answer