wilcox.test(x, y, alternative="two.sided", mu=0, paired=F, exact=T, correct=T)
For the one-sample Wilcoxon signed rank test, the null hypothesis is that the median of the distribution of x (if only x is supplied) is mu. For the two-sample paired case, where both x and y are provided (and paired is TRUE), the null hypothesis is that the median of the distribution of x - y is mu.
For the Wilcoxon signed rank test the values of x or x - y are independent observations from the same symmetric distribution.
The Wilcoxon signed-rank test statistic, V, is the rank sum of those abs(x - mu - y) with x - mu - y > 0. For n = length(x) greater than 25, a normal approximation is used to compute the probability (or if exact=F). See the hard copy help file for the Normal approximation used for the test statistic. If there are ties in the absolute values of the differences, x - mu - y, an exact probability for the test cannot be computed. The normal approximation given by Lehmann (1975, p. 130) is used in this case.
Lehmann, E. L. (1975). Nonparametrics: Statistical Methods Based on Ranks. Holden and Day, San Francisco.
# A Wilcoxon rank sum test wilcox.test(x, y) # A Wilcoxon signed rank sum test wilcox.test(x, y, paired=T)