1
$\begingroup$

I ran wilcox.test() in R (outcome variable was a test score and the data was paired samples) and got a warning message saying that it cannot generate a p-value for tied values. I saw the R document and it said when there are ties, normal approximation was used. What does this really mean?

edit: I ran wilcox.test() from {stats} where I specified paired= TRUE>

$\endgroup$
2
  • $\begingroup$ @Glen_b Thank you for pointing that out. I just edited it. For some reason stack exchange automatically turned the 'w' into a capital letter when I typed it. I put paired=TRUE so I assumed I ran the signed-rank test. $\endgroup$
    – JNB
    Commented May 8, 2019 at 4:18
  • $\begingroup$ It might be some facility of your browser (or phone interface if you're using a phone) rather than Stack Exchange. My answer focuses on the rank sum test but also mentions the signed rank test -- the points are all essentially identical for the signed rank test, just the specific distribution, means and standard deviations change. That is the picture would look slightly different, but essentially with the same point and the discussion is the same, mutatis mutandis. $\endgroup$
    – Glen_b
    Commented May 8, 2019 at 4:52

1 Answer 1

1
$\begingroup$

The error message is slightly misleading. If there are no ties, there are (fairly simple) ways to calculate the exact distribution (when $H_0$ is true) of the Wilcoxon-Mann-Whitney test statistic (and the signed rank test statistic), and R comes with the usual functions - pmfs, cdfs, inverse cdfs and random generators for both.

If there are ties, it is still possible to calculate the distribution of the statistic, but it's no longer so easy and may become quite time consuming.

However, a standardized version of this statistic $\frac{U-\mu_U}{\sigma_U}$ (and $\frac{W-\mu_W}{\sigma_W}$ for the signed rank) has a distribution that fairly quickly (as sample sizes become larger) becomes close to a standard normal distribution, and that can be used to get an approximate p-value for either test.

plot of cdf of standardized Wilcoxon-Mann-Whitney - with continuity correction - and normal approximation

Which is to say, the vertical position of the black dots (and consequently, calculation of p-values) may be closely approximated by the height of the red curve at the same value. Even at fairly small sample sizes the approximation is often quite good.

Exactly the same kind of thing happens with the signed rank test.

When there are ties, this approximate normality is still the case (though it happens more slowly, especially with a lot of ties), and while it is altered by the presence of ties, we can calculate the population standard deviation if we know what the pattern of tied ranks is.

The formula for the standard deviation when there are ties is given at the relevant Wikipedia page

While the Wikipedia article for the signed rank test doesn't seem to give it, there's a similar change to the formula for the standard deviation of the signed rank test under ties (see Conover, Applied Nonparametric Statistics, for example) and everything proceeds in essentially the same way in either case.

As for why it happens as sample sizes grow, you can write either statistic as a sum of terms, and hence (with a little care) apply a version of the Central limit theorem.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.