Hi,
The Mann-Whitney test reports reversed sign for the mean difference.
See the attached figure.
Also, I don't know how the reported statistic is calculated. It is different from W reported by wilcox.test
The p-value is the same, so I suppose it must be a transformation
Victor
Inconsistent mean differences sign for Mann-Whitney test
Inconsistent mean differences sign for Mann-Whitney test
- Attachments
-
- screenshot_03.png (99.76 KiB) Viewed 1836 times
Re: Inconsistent mean differences sign for Mann-Whitney test
oh this keeps biting me.
so mann-whitney produces two U statistics, and you're supposed to use the smaller value.
but the wilcox.test in R has a bug/feature where it gives you one of the U statistics, but not necessarily the smaller one. so we have to run it both ways, see which is the smaller U value, and use that.
to run it both ways, i just swap the groups. this first bit me, because i wasn't using the right p-value with the one-sided tests. now it's bitten me because i didn't adjust the means!
anyhow, thanks for reporting, i'll commit a fix now.
cheers
jonathon
ps. when somethings clearly a bug, it's best to report it in the github issue tracker.
so mann-whitney produces two U statistics, and you're supposed to use the smaller value.
but the wilcox.test in R has a bug/feature where it gives you one of the U statistics, but not necessarily the smaller one. so we have to run it both ways, see which is the smaller U value, and use that.
to run it both ways, i just swap the groups. this first bit me, because i wasn't using the right p-value with the one-sided tests. now it's bitten me because i didn't adjust the means!
anyhow, thanks for reporting, i'll commit a fix now.
cheers
jonathon
ps. when somethings clearly a bug, it's best to report it in the github issue tracker.