# Significant p value for Mann-Whitney U test but low AUC

How is it possible that for two sample sets I'm getting a low p-value, but also a low AUC value (just below 0.5)?

To compute the P-value I'm looking at the second outputted value of the function here http://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.stats.mannwhitneyu.html

For the AUC I'm using the same function's first outputted value divided by the product of the sample sets lengths.

And here is a boxplot of the two series:

• Because this question is at least partly tied with a specific software/language which some people potentially able to help you don't use - you should give a data and the results they produce. So that people can try to reproduce the results in the software they know. – ttnphns Nov 5 '14 at 12:35
• Are you sure you're getting the right statistic? - you might be calculating the area above the ROC curve. – Scortchi - Reinstate Monica Nov 11 '14 at 13:16
• Yeah but it's still close to 0.5 so same same. – Uri Nov 12 '14 at 8:09
• @ttnphns I've added a boxplot. I don't really know how to transfer the sample sets. – Uri Nov 12 '14 at 10:34
• What sufficiently large sample sizes the area under the receiver operating characteristic curve (AUC) could be "close" to 0.5, yet the one-sided p-value for the Mann-Whitney test "low" (as long as the AUC is greater than 0.5). Another thing to check might be exactly how the statistic's computed - there are some different versions. – Scortchi - Reinstate Monica Nov 12 '14 at 10:48

Mann-Whitney p-values (using the normal approximation) vs AUC for some different sample sizes ($n_1,n_2$):
• @Uri: There should be no question of a correlation between AUC & the calculated p-value for given sample sizes: An observed AUC $c$ together with sample sizes $n_1$ & $n_2$ determines a p-value of $1-\Phi\left[n_1n_2 \left(c - \frac{1}{2}\right) / \sqrt{\frac{n_1n_2(n_1+n_2+1)}{12}}\right]$ where $\Phi(\cdot)$ is the standard Gaussian distribution function. With both sample sizes at 500, an AUC of a little over 0.53 would give a p-value of 0.03, so your calculation seems correct. – Scortchi - Reinstate Monica Nov 12 '14 at 13:34