# [R] What are ties? Wilcox u-test

(Ted Harding) Ted.Harding at manchester.ac.uk
Wed Apr 30 10:25:01 CEST 2008

```On 30-Apr-08 07:47:56, Uwe Ligges wrote:
> Dirkheld wrote:
>> Hi,
>> When I execute a Wilcox u-test on two variables I receive a
>> warning : 'cannot compute exact p-value with ties'
>> - What are ties? What does this mean for my data?
>
> If you have two identical values in your data, these are called
> ties. Now the ranks are not unique anymore and hence exact
> p-values cannot be calculated.
> And since you do not know this, it might be worth to note that
> the Wilcoxon test also assumes a non-skewed distribution.

For the sake of clarification, it should be emphasised that
"assumes a non-skewed distribution" applies only to the paired
two-sample case ("signed-rank") or the single sample case.
In this case the Wilcoxon test is in effect a test of symmetry.

I think this is reasonably clear from ?wilcox.test.

Dirkheld did not state that he was using the "paired" test,
and may well simply have been comparing two samples (possibly
of different sizes) of values of X and Y.

When the Wilcoxon test is used to compare two samples of
values which are not paired, it makes no assumption about
the shape of the distribution, only that (as null hypothesis)
the distribution from which X is sampled is the same as the
distribution from which Y is sampled. It is, in effect,
based on an estimate of P(X < Y).

In this respect, I think ?wilcox.test is misleading. While
people commonly think that the Wilcoxon test (or its equivalent
the Mann-Whitney U test) is a test of "shift in location",
this is only a special case of the class of alternatives
(to the null hypothesis that the distributions are the same)
to which the Wilcoxon (or Mann-Whitney) test is sensitive.

In particular, the expected value of the Wilxoxon (or the
Mann-Whitney) test statistic is a linear function of
P(X < Y).

Hoping this helps,
Ted.

>> - Is that a problem for significance testing?
>
> If there are just a few ties, you should not worry, but re-check how
> your data looks like. It is a warning, not an error message.
>
>
>> - is there a way to overcome this problem?
>
> If you need to, use an appropriate test for your data.
>
>
>> I have different threads in this forum but it hard to find what the
>> exact
>> meaning of this warning message is.
>
>
> Uwe Ligges
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help