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

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?

• alternative hypothesis: true location shift is not equal to zero is just telling you what the alternative hypothesis is. It's not telling you the result of the test. For the test result, look to the reported p value. Sep 12 '19 at 2:06
• does this mean that its entirely up to me deciding which hypothesis to take based on the p-value? if that is the case everything makes sense now lol Sep 12 '19 at 2:22
• Yes, it's up to you to decide. Usually it's framed as rejecting the null or failing to reject the null. Sep 12 '19 at 2:36
• Excellent thank you for clearing that up, maybe you could post a short answer so I can accept it? Sep 12 '19 at 21:37

Answer from comments: The text alternative hypothesis: true location shift is not equal to zero is just telling you what the alternative hypothesis is. It's not telling you the result of the test. For the test result, look to the reported p value. Based on the p value and your selected alpha value, you either reject the null hypothesis or fail to reject the null hypothesis.