Example of rejected alternative hypothesis of a Wilcoxon rank sum test?

by MikeKatz45   Last Updated September 12, 2019 02:19 AM

I've recently looked into the Wilcoxon Rank Sum test for comparing groups of continuous values. In particular I've been using R's wilcox.test() function for this task.

While using the test on my real data I noticed I wasn't getting any instances of the test rejecting the alternative hypothesis and all outputs always said alternative hypothesis: true location shift is not equal to 0. I proceeded to do a quick test in R to see how a rejected alternative hypothesis result would look like:

>test1 <- c(1, 2, 3, 4, 5)
>test2 <- c(1, 2, 3, 4, 5)
>test <- wilcox.test(test1, test2, alt="two.sided")

I was totally expecting a rejected alternative hypothesis here since both groups of values are equal but oh surprise:

> test

    Wilcoxon rank sum test with continuity correction

data:  test1 and test2
W = 12.5, p-value = 1
alternative hypothesis: true location shift is not equal to 0

By no means I'm experienced using Wilcoxon test, but I really can't see why the alternative hypothesis is accepted in this case. I know that the null hypothesis for this test expects the median of both groups to be equal, so I can't really tell why the example above didn't work as expected. Maybe this could be a matter of result interpretation in R? What would be a small example in which the alternative hypothesis would be rejected then?

Related Questions

Wilcoxon signed rank test on anonymous sample

Updated April 04, 2017 16:19 PM

Statistical method comparing difference in tails

Updated April 03, 2018 22:19 PM

Non parameteric tests for 2*2 mixed design

Updated March 19, 2017 13:19 PM

Minimum sample for non parametric test?

Updated March 20, 2017 12:19 PM