2
$\begingroup$

In a repeated measure design, I have two measurements for one variable for N=5 subjects. I am interested in assessing whether the distribution of the differences between the two measurements is symmetrical around zero. For this reason, I am performing a Wilcoxon Signed-Rank test with wilcox.test() in R.

However, due to a zero in my differences, I am warned in R that I cannot get an exact p-value. The warning I get is:

Warning message: In wilcox.test.default(x, y, paired = TRUE) : cannot compute exact p-value with zeroes

More specifically, what I am understanding is that a continuity correction will be applied to my p-value since my T statistic will be compared against a normal approximation of the T distribution. Am I understanding this correctly? I am understanding that similarly this happens also when there are ties in the difference values.

Moreover, due to the low numerosity of my sample, I understand that approximating the T distribution to a normal one is not the ideal solution, so I am shifting to the wilcoxsign_test() function from the coin package. By using the distribution = "exact" argument, it seems to me that the wilcoxsign_test() function will compare the T statistic computed on my data against the T distribution computed by permuting all my data. Is this correct? Moreover, handling of ties (and zeroes?) will be carried out according to the Pratt (1959) method (default). Am I correct?

Finally, does the distribution = "asymptotic" argument correspond to perform a normal approximation?

$\endgroup$
7
  • $\begingroup$ Exclude the cases with difference = 0. $\endgroup$
    – user158565
    Oct 21, 2018 at 17:27
  • $\begingroup$ Continuity correction doesn't really relate to ties; continuity correction may be applied when using a continuous approximation to the null-distribution of the test statistic because the statistic itself is discrete. $\endgroup$
    – Glen_b
    Oct 22, 2018 at 3:20
  • $\begingroup$ @Glen_b thanks for your reply. What if I use the distribution = "exact" argument in the coin::wilcoxsign_test()? In my understanding this will permute my samples and estimate the T distribution under the null hypothesis. Then (still in my understanding) my data's T value will be compared against this null distribution and I will get a p-value accordingly. Is this that happens with the distribution = "exact" argument? If so I guess that no continuity correction will be applied. $\endgroup$
    – mariamelie
    Oct 22, 2018 at 14:23
  • $\begingroup$ @a_statistician , wouldn't you advise using the Pratt or Wilcoxon correction for zero differences rather than excluding those cases? $\endgroup$ Oct 22, 2018 at 17:50
  • $\begingroup$ Your situation is very similar to what the McNemar test. On McNemar test, if A = B then the case will be excluded, because this case does not give you any information. $\endgroup$
    – user158565
    Oct 22, 2018 at 19:57

1 Answer 1

3
$\begingroup$

There are several questions here. I will attempt to assemble some the comments and my own thoughts into an answer. A caveat here is that I'm not entirely familiar with the programming of these functions, so there may be misconceptions in the following answer.

Note that this question pertains to the paired or one-sample tests.

Warning. The warning message from wilcox.test doesn't imply that the test results are invalid. It merely means what it says: The test can't compute an exact p-value when there are zero differences. Instead it will remove the zeros and compute the p-value by asymptotic approximation. The following two calls give the same result:

wilcox.test(c(0,1,2,3,4), exact=F)

wilcox.test(c(1,2,3,4), exact=F

Continuity correction: The continuity correction is applied only when the p-value is computed by asymptotic approximation. So the following give the same result:

wilcox.test(c(1,2,3,4), exact=T, correct=F)

wilcox.test(c(1,2,3,4), exact=T, correct=T)

but the following give different results:

wilcox.test(c(1,2,3,4), exact=F, correct=F)

wilcox.test(c(1,2,3,4), exact=F, correct=T)

I'm pretty sure the wilcoxsign_test function never applies the continuity correction.

Handling of zero differences: As mentioned above, when there are zero differences, the wilcox.test function removes those zeros, and uses the asymptotic approximation for the p-value.

The wilcoxsign_test function can compute an "exact" p-value when there are zero differences. For example,

wilcoxsign_test(c(0,0,0,0,0)~c(0,1,2,3,4), distribution="exact").

The wilcoxsign_test function can handle zero differences in two ways, so that the following give different results: Pratt and Wilcoxon:

wilcoxsign_test(c(0,0,0,0,0)~c(0,1,2,3,4), distribution="approximate", zero.method="Pratt")

wilcoxsign_test(c(0,0,0,0,0)~c(0,1,2,3,4), distribution="approximate", zero.method="Wilcoxon")

But I don't think these methods differ if distribution="exact" is used. I'm not sure.

With wilcoxsign_test, I think using distribution="asymptotic" and zero.method="Wilcoxon" will result in the same handling as would wilcox.test, so that the following two give the same result:

wilcoxsign_test(c(0,0,0,0,0)~c(0,1,2,3,4), distribution="asymptotic", zero.method="Wilcoxon")

wilcox.test(c(0,1,2,3,4), exact=F, correct=F)

$\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.