I have a question about using wilcox.test in R.
I have the following code/data:
a <- c(1,1,1,1,1,2,2,2,2)
b <- c(1,1,1,1,1,1,1,1)
results <- wilcox.test(a,b, conf.int = T, exact = F)
print(results)
The code above returns the following:
> Wilcoxon rank sum test with continuity correction
>
> data: a and b W = 52, p-value = 0.04271 alternative hypothesis: true
> location shift is not equal to 0 95 percent confidence interval: 0 1
> sample estimates: difference in location
> 9.415723e-05
As you can see the p-value is less than 0.05 but is not exact. In fact, when I make exact parameter TRUE then I get the warning message that exact p-value cannot be computed:
1: In wilcox.test.default(a, b, conf.int = T, exact = T) :
cannot compute exact p-value with ties
Here are my questions:
Even though the p-value is less than 0.05, the confidence interval includes 0. How am I supposed to interpret such data? Is the statistical test significant?
After performing two-tailed Wilcoxon test in R, what is the correct way to interpret which group's distribution is significantly higher/lower? Do you look at the confidence interval or the difference in location?
How do you interpret the test result when the confidence interval cannot be computed because all observations are tied?
Thank you.
library(samplesize); n.wilcox.ord(power = 0.8, alpha = 0.05, 0.5, c(5/9, 4/9), c(1, 0))
. With such high proportions of equal values between both samples you'd need a quite high n (a quick tests suggest about 10 times what you have) for zero not to be included in the approximate CI. The answer to 3.) is that you really should increase the sample size. $\endgroup$