Skip to content

Wilcoxon Test and Mean Ratios

9 messages · Mohamed Radhouane Aniba, Thomas Lumley, Ben Bolker +3 more

#
Hello All,

I am writing to ask your opinion on how to interpret this case. I have two vectors "a" and "b" that I am trying to compare.

The wilcoxon test is giving me a pvalue of 5.139217e-303 of a over b with the alternative "greater". Now if I make a summary on each of them I have the following
Min.   1st Qu.    Median      Mean   3rd Qu.      Max. 
0.0000000 0.0001411 0.0002381 0.0002671 0.0003623 0.0012910
Min.   1st Qu.    Median      Mean   3rd Qu.      Max. 
0.0000000 0.0000000 0.0000000 0.0004947 0.0002972 1.0000000

The mean ratio is then around 0.5399031 which naively goes in opposite direction of the wilcoxon test ( I was expecting to find a ratio >> 1)

Even after removing outlier using the outlier package, I still have the same thing. Can someone help me explain why I do have this result and how to explain it ?

Thanks in advance

Rad
#
On Thu, Sep 20, 2012 at 5:46 AM, Mohamed Radhouane Aniba
<aradwen at gmail.com> wrote:
There's nothing conceptually strange about the Wilcoxon test showing a
difference in the opposite direction to the difference in means.  It's
probably easiest to think about this in terms of the Mann-Whitney
version of the same test, which is based on the proportion of pairs of
one observation from each group where the `a' observation is higher.
Your 'c' vector has a lot more zeros, so a randomly chosen observation
from 'c' is likely to be smaller than one from 'a', but the non-zero
observations seem to be larger, so the mean of 'c' is higher.

The Wilcoxon test probably isn't very useful in a setting like this,
since its results really make sense only under 'stochastic ordering',
where the shift is in the same direction across the whole
distribution.

  -thomas
#
Mohamed Radhouane Aniba <aradwen <at> gmail.com> writes:
No, because a t-test makes even stronger parametric assumptions.
You were given more specific advice on stackoverflow 
http://stackoverflow.com/questions/12499687/wilcoxon-test-and-mean-ratios
If you want to prove that there is *some* difference between the
distributions, you're done. If you want to test for some specific
difference, you need to think more about what kind of test you want
to do.  Permutation tests with various test statistics are a way
to approach that.

  Ben Bolker
vectors "a" and "b" that I am trying
[snip]
#
On Sep 20, 2012, at 02:43 , Thomas Lumley wrote:

            
I was sure I had seen a definition where X was "larger than" Y if P(X>Y) > P(Y<X), but that's obviously not the normal definition. Anyways, it is worth emphasizing that that is what the Wilcoxon test tests for, not whether the means differ, nor whether the medians do. As a counterexample of the latter, try

x <- rep(0:1, c(60,40))
y <- rep(0:1, c(80,20))
wilcox.test(x,y)
median(x)
median(y)

(and the "location shift" reference in wilcox.test output is a bit of a red herring.)
#
Hi,

http://en.wikipedia.org/wiki/Wilcoxon_signed-rank_test

We can clearly see that null hypothesis is median different or not.
One way of proving non difference is P(X>Y) = P(X<Y) where X and Y are
ordered.
On 9/20/12, peter dalgaard <pdalgd at gmail.com> wrote:

  
    
#
On Fri, Sep 21, 2012 at 6:43 AM, avinash barnwal
<avinashbarnwal123 at gmail.com> wrote:
Avinash.  No.

Firstly, the Wikipedia link is for the WIlcoxon signed rank test,
which is a different test and so is irrelevant. Even if the
signed-rank test were the one being discussed, you are still
incorrect. The signed rank test is on the median of differences, not
the difference in medians.  These are not the same, and need not even
be in the same direction.

Secondly, it is easy to establish that the WIlcoxon rank sum test need
not agree with the ordering in  medians, just by looking at examples,
as Peter showed

Thirdly,  there is a well-known demonstration originally due to Brad
Efron, "Efron's non-transitive dice', which implies that the
Mann-Whitney U test (which *is* equivalent to the Wilcoxon rank-sum
test) need not agree with the ordering given by *any* one-sample
summary statistic.

In this case, assuming the sample sizes are not too small (which looks
plausible given the p-value), the question is what summary the
original poster want's to compare: the mean (in which case the t-test
is the only option) or some other summary.  It's not possible to work
this out from the distribution of the data, so we need to ask the
original poster.  With reasonably large sample sizes he can get a
permutation test and bootstrap confidence interval for any summary
statistic of interest, but for the mean these will just reduce to the
t-test.

Rank tests (apart from Mood's test for quantiles, which has different
problems) can really behave very strangely in the absence of
stochastic ordering, because without stochastic ordering there is no
non-parametric way to define the direction of difference between two
samples.  It's important to remember that all the beautiful theory for
rank tests was developed under the (much stronger) a location shift
model: the distribution can have any shape, but the shape is assumed
to be identical in the two groups.  Or, as one of my colleagues puts
it "you don't know whether the treatment raises or lowers the outcome,
but you know it doesn't change anything else".

Knowledgeable and sensible statisticians who like the Wilcoxon test
(Frank Harrell comes to mind) like it because they believe stochastic
ordering is a reasonable assumption in the problems they work in, not
because they think you can do non-parametric testing in its absence.


   -thomas
#
On 2012-09-20 21:07, Thomas Lumley wrote:
I'll just chime in here and point towards the Fay and Proschan (2010) 
paper discussing decision rules, and their assumptions, in the 
two-sample situation.  It's freely available at 
http://www.i-journals.org/ss/viewarticle.php?id=51


Henric