5

I'm unsure how to calculate the effect size after applying a Wilcoxon rank-sum test. I'm using scipy.stats.ranksums, where the outputs are z, p. Looking at the implementation of the test, it seems z is assumed to be normally distributed - could I just calculate Cohen's d as discussed here?

I'm confused since Wikipedia offers alternative effect sizes for these non-parametric tests, but then also, the article states that the Wilcoxon rank-sum and the Mann-Whitney-U tests are the same, while scipy clearly implements them quite differently. Unfortunately, I cannot apply the MWU test since some of my comparisons involve samples with zero variance which leads to errors with MWU but not rank-sums.

mdewey
  • 16,541
  • 22
  • 30
  • 57
Lisa
  • 537
  • 6
  • 15
  • You can't assume that a *constant* column is has a sum of ranks that is normally distributed. Indeed scipy.stats.ranksums *doesn't handle ties*. Did you read the documentation for these functions? It's quite clearly stated. – Glen_b Aug 11 '16 at 08:29
  • 2
    Depending on your needs, you can show Kendall's rank correlation between the binary grouping variable and your numeric column. A test on this correlation will provide similar p value than the rank sum test. – Michael M Aug 11 '16 at 08:35

1 Answers1

1

Had the exact same question. According to this post and Wilcox (p166) you shouldn't calculate Z and Cohen's D respectively because their calculation is based on the normality assumption.

Wilcox provides robust alternatives to Cohen's D (p166-170) including R code in his book. Got the book from my library. It is also available as e-book in both library networks I have access to.

http://store.elsevier.com/Introduction-to-Robust-Estimation-and-Hypothesis-Testing/Rand-Wilcox/isbn-9780123870155/

There are a couple of other posts in this forum asking very similar questions (effect size for Wilcoxon, one sample Wilxocon or Mann-Whitney-U tests just to name a few). You might like to look at those too.

Simone
  • 170
  • 6