2

There are different ways to calculate the test statistic for the Wilcoxon rank sum test (quote from R help):

The literature is not unanimous about the definitions of the Wilcoxon rank sum and Mann-Whitney tests. The two most common definitions correspond to the sum of the ranks of the first sample with the minimum value subtracted or not: R subtracts and S-PLUS does not, giving a value which is larger by m(m+1)/2 for a first sample of size m. (It seems Wilcoxon's original paper used the unadjusted sum of the ranks but subsequent tables subtracted the minimum.)

Since I compare the test statistic ("W" in R) to the limit of the rejection region (defined by a quantile of the Wilcoxon distribution) to decide whether to reject my null hypothesis, the differing values would lead to quite different decisions in some borderline cases.

Can anyone explain what that means and how I must deal with it?

This question is a follow up to Wilcoxon rank sum test in R

  • 1
    Just make sure you're comparing any test statistic to quantiles of *that* test statistic & not a different one. – Scortchi - Reinstate Monica Jul 29 '13 at 11:24
  • I wasn't aware that there are different Wilcoxon rank sum distributions. What are they and how do I pick the right one? –  Jul 29 '13 at 11:40
  • 1
    The two versions of the test statistic are equivalent because they differ by a constant depending only on sample sizes. You don't need to pick one, just to make sure you refer to the correct table of percentiles (& of course R isn't going to perversely refer the "W" statistic to the wrong table). – Scortchi - Reinstate Monica Jul 29 '13 at 11:46
  • I seem to recall there are some different ways of treating tied values, which can make a difference; if you want to know about that perhaps mention it specifically in the question. – Scortchi - Reinstate Monica Jul 29 '13 at 12:05
  • 1
    It just shifts the whole distribution along by $n_1(n_1+1)/2$, sample test statistic, quantiles and all. If you're doing it R, the solution I offered you there gives you the correct p-value (since the p-value was computed $W$ vs null distribution of $W$, and you want $T_W$ vs null distribution of $T_W$ and both are shifted by the same amount). [I am not sure I understand the difficulty here, it's a bit like saying "I know how to tell if I have cut this piece of wood the right size but if I change from measuring in cm to mm, how do I know if it's the right size now?" ... did I miss something?] – Glen_b Jul 30 '13 at 05:42
  • Thank you, @Glen_b, I understand. How does *any* test statistic relate to *any* distribution? Is there a common relation like its always the median. I know it isn't the median, but how can I arrive at the test statistic from the distribution; it does not appear to be part of the formula ... –  Jul 30 '13 at 06:20
  • I'm learning statistics, and I have all these formulas to calculate the test statistics for different distributions, and I have these formulas to calculate the quantiles, and I have all these distributions, but I cannot see a common rule how the three parts relate to each other. –  Jul 30 '13 at 06:26
  • I'm not quite sure what you're asking there. When you do a hypothesis test, you compare the value of the test statistic to the distribution of the test statistic when $H_0$ is true. You then work out [the probability of getting a statistic at least as extreme as the one you observed](http://en.wikipedia.org/wiki/P-value). (What counts as 'extreme' depends on your alternative - the cases most consistent with the alternative are the ones in your rejection region.) – Glen_b Jul 30 '13 at 06:27
  • The easiest case to consider is when you're doing a one-tail test with a "less-than" alternative. Then your p-value is simply the proportion of the *null distribution of your test statistic* below the sample test statistic. That is, the p-value is its CDF, $F_0(T)$. The other tail is just $1-F_0$ and the two-tailed version looks in both tails. – Glen_b Jul 30 '13 at 06:30

0 Answers0