[SciPy-user] help with scipy.stats.mannwhitneyu

josef.pktd@gmai... josef.pktd@gmai...
Thu Feb 5 10:39:19 CST 2009


On Thu, Feb 5, 2009 at 10:36 AM,  <josef.pktd@gmail.com> wrote:
> On Thu, Feb 5, 2009 at 9:38 AM, Sturla Molden <sturla@molden.no> wrote:
>> On 2/5/2009 3:33 PM, josef.pktd@gmail.com wrote:
>>
>>> wilcoxon is a similar test for paired instead of independent samples,
>>> and there the recommendation in the docstring is for N>20.
>>
>> There are two Wilcoxon tests. The signed-rank test for paired samples
>> and the rank-sum test for independent samples.
>>
>
> According to wikipedia, Mann-Whitney-U is the Wilcoxon rank-sum test
> for independent samples, just a different name.
>
> Josef
>

So far:

According to R:
wilcox.test(x,y)
Performs one and two sample Wilcoxon tests on vectors of data; the
latter is also known as 'Mann-Whitney' test.

I tried a normal random variable example ( no ties): the test
statistic returned is exactly the same as the one returned by
stats.mannwhitneyu(x,y) however the p-values differ. the pvalue in
stats is half of the one in R (up to 1e-17) as stated in the
docstring:  one-tailed p-value.

In R the test statistic is the same for the two sided and the one
sided tests, but the reported p-values differ.

 I used sample size 100.

So there is an inconsistency in the reporting in stats.mannwhitneyu,
the test statistic is for the two-sided test, but the p-value is half
of the two sided p-value and should be multiplied by two.

I haven't checked the tie handling.
Josef


More information about the SciPy-user mailing list