title: Wilcoxon signed rank test for heavily tied data
body: <p>I am having trouble conducting Wilcoxon test analyses on heavily tied data. I have outlined my problem as best I can below, how I have tried to address it, and the questions I have. I'd be really grateful for any advice anyone could give me.</p>
  <p><strong>My Problem</strong> I am working on a dataset where I need to compare three groups on a measure which was used for group assignment. When I run a one-way ANOVA, neither <strong>(1)</strong> the assumption of normality of residuals, nor <strong>(2)</strong> the assumption of homogeneity of variance of residuals is met.</p>
  <p>I therefore used the Wilcoxon test to conduct pairwise comparisons in r with the following code (example for one comparison, two-sided alternative hypothesis as default):</p>
  <p>measure ~ group, data= myreduceddataset, na.rm=TRUE, paired=FALSE, exact=TRUE, conf.int=TRUE</p>
  <p>However, the output of my analysis looked strange to me <a href="https://i.stack.imgur.com/u2Pfv.png" rel="nofollow noreferrer">(screenshot of example here)</a>, and gave up errors for every comparison (one example copied below):</p>
  <p><em>Warning messages:
  1: In wilcox.test.default(x = c(2, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0,  :
  cannot compute exact p-value with ties
  2: In wilcox.test.default(x = c(2, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0,  :
  cannot compute exact confidence intervals with ties</em></p>
  <p><strong>Checking the data</strong> I then checked the data and looked at how the data are ranked in R to try to figure out the error. It seems as though, although there are some tied ranks throughout, the main problem is the number of 0 values in Group 1 <a href="https://i.stack.imgur.com/RfMtz.png" rel="nofollow noreferrer">here is some example raw and ranked data by group</a></p>
  <p><strong>The solution I found, and questions this raised</strong> From reading around, it appears that the solution to this could be to use the test from the 'Coin' package in R.</p>
  <p>I had a go, and <a href="https://i.stack.imgur.com/MNSrO.png" rel="nofollow noreferrer">here is an example of my output</a>. However, I am still not entirely clear on whether this is correct, and I have outlined some questions I still have below.</p>
  <ol>
  <li>I am not sure if an asymptotic test or an exact test is more appropriate for this dataset (the output appears to be the same)</li>
  <li>I am assuming I should use the coin::wilcox_test() <em>not</em> the coin::wilcoxsign_test(), as I am comparing samples from independent groups. Is this correct?</li>
  <li>If I am understanding correctly, the 'Z' value is the effect size. How do I derive the W statistic? Or can I just report the effect size?</li>
  <li>I am not sure how to correct this output for multiple comparisons</li>
  </ol>
  <p>I'd be more than happy to give more detail if it would be helpful. Many thanks in advance.</p>
  <p>UPDATE: Simulated data (same group means and SDs) here:</p>
  <pre><code>structure(list(measure = c(9, 15, 6, 7, 8, 7, 12, 5, 14, 9, 7, 
  13, 8, 14, 11, 16, 9, 7, 3, 8, 3, 21, 4, 3, 11, 13, 5, 7, 8, 
  15, 5, 15, 3, 9, 5, 2, 8, 6, 1, 1, 7, 6, 9, 5, 6, 2, 6, 10, 6, 
  6, 8, 6, 9, 8, 6, 2, 6, 2, 9, 5, 6, 4, 10, 7, 9, 8, 6, 4, 6, 
  14, 1, 12, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 
  0, 0, 0, 0, 0, 0, 1, 1, 2, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 
  0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0), group = structure(c(3L, 
  3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 
  3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 
  3L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
  2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
  2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
  1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
  1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
  1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), .Label = c(&quot;1&quot;, &quot;2&quot;, &quot;3&quot;
  ), class = &quot;factor&quot;)), row.names = c(NA, -122L), class = &quot;data.frame&quot;)
  </code></pre>