Get the data from here and read it into R:
Lets first have a look at the data via a violin plot:
It is quite easy to perform a wilcoxon-test with the function wilcox.test:
It works with the usual formula-notation, additional I specified the continuity correction.
For a one-sided test we can specify the argument ‘alternative’:
The p-values are the same as with SAS, however we get a warning since we have ties in our data (I don’t know how SAS handles this):
> cannot compute exact p-value with ties
If we want to compute exact p-values in the presence of ties, we could use wilcox_test() from the coin package:
Here I also specified to output the 95%-Confidence-Interval via the ‘conf.int’ argument.
Code and data are available at my github-repo under file name ‘p42’.