# Wilcoxon-Mann-Whitney critical values in R

I have noticed that when I try to find the critical values for the Mann-Whitney U using R, the values are always 1+critical value. For example, for $\alpha=.05, n = 10, m = 5$, the (two-tailed) critical value is 8, while for $\alpha=.05, n=12, m=8$, the (two-tailed) critical value is 22 (check the tables), but:

> qwilcox(.05/2,10,5)
 9
> qwilcox(.05/2,12,8)
 23


Of course I'm not considering something, but... anyone could explain me why?

I think that the answer here might be that you're comparing apples and oranges.

Let $F(x)$ denote the cdf of the Mann-Whitney $U$ statistic. qwilcox is the quantile function $Q(\alpha)$ of $U$. By definition, it is therefore $$Q(\alpha)=\inf \{x\in \mathbb{N}: F(x)\geq \alpha\},\qquad \alpha\in(0,1).$$

Because $U$ is discrete, there is usually no $x$ such that $F(x)=\alpha$, so typically $F(Q(\alpha))>\alpha$.

Now, consider the critical value $C(\alpha)$ for the test. In this case, you want $F(C(\alpha))\leq \alpha$, since you otherwise will have a test with a type I error rate that is larger than the nominal one. This is usually considered to be undesirable; conservative tests tend to be prefered. Hence, $$C(\alpha)=\sup \{x\in \mathbb{N}: F(x)\leq \alpha\},\qquad \alpha\in(0,1).$$ Unless there is an $x$ such that $F(x)=\alpha$, we therefore have $C(\alpha)=Q(\alpha)-1$.

The reason for the discrepancy is that qwilcox has been designed to compute quantiles and not critical values!

• (+1) Good, simple, concise description. :) Jul 18, 2012 at 12:31

Remember that the rank sum test statistic is discrete and so you need to use a critical value such that the tail probability is $\geq$ to the specified $\alpha$. For some sample sizes equal to alpha cannot be achieved and that is my guess as to why you need the +1.

• So why is +1 needed in R and not in the usual tables? Jul 17, 2012 at 11:14
• @this.is.not.a.nick: perhaps more importantly, $0.0236723<0.025$ whereas $0.02868937>0.025$, which means that in the former case the actual significance level will be $<0.05$ and that in the latter it will be $>0.05$. Usually people tend to prefer to err on the right side, i.e. to have a lower significance level than the nominal one (meaning that the values from the tables are preferable). Jul 17, 2012 at 11:33
• Right to both Procrastinator and MansT. Actually the definiton of significance level requires that the tail probabilities do not sum to anything higher than alpha. I talk about this in my paper with Christine Liu on the sawtoothed behavior of the power function for exact binomial tests via the Clopper-Pearson method (see American Statistician (2002)). Jul 17, 2012 at 11:56
• @Michael: It's on the same page as this one. The tables follow the standard defintion, which means that the critical values aren't quantiles. Jul 17, 2012 at 12:20
• @Michael: Agreed. In some sense, qwilcox does what it's supposed to do, but not what you'd expect it do to. Jul 17, 2012 at 12:42