Two-sample Wilcoxon Test

DESCRIPTION:

This function is used by the Two-sample Wilcoxon Test dialog.

USAGE:

menuWilcoxTest2(data=NULL, x, y, groups.p=F, mu=0,  
                alternative="two.sided", w.paired="Rank Sum", 
                exact=T, correct=T, print.object.p=T) 

REQUIRED ARGUMENTS:

x
a numeric vector. Missing values ( NAs) are allowed but ignored at calculation. If groups.p is FALSE, x is the first sample. If groups.p is TRUE, x is the response variable of two samples and y is the grouping indicator.
y
a numeric vector. If supplied a two sample test is performed. If w.paired= "Signed Rank", then x and y must have the same length. Missing values ( NAs) are allowed but ignored at calculation. If groups.p is FALSE, y is the second sample. If groups.p is TRUE, y is the grouping indicator with the first observation indicating the first sample. Only two groups are allowed.

OPTIONAL ARGUMENTS:

data
a data frame in which to interpret the variables named in the x and y. If this is missing, then x and y must be two vectors.
groups.p
if TRUE, x is the response variable of two samples and y is the grouping indicator. Paired t test is not available for this input format. If FALSE, x is the first sample and y is the second sample.
mu
For the Wilcoxon rank sum test, the null hypothesis is that the locations of the distributions of x and y, the first and the second sample, differ by mu. For the two-sample paired case, the null hypothesis is that the median of the distribution of x - y is mu.
alternative
a character string specifying the alternative hypothesis, "greater" (the location of x is greater than that of y) or "less" (the location of x is less than that of y) or "two.sided" (the locations of x and y are different). Only enough of the string to determine a unique match is required.
w.paired
if "Signed Rank", x and y are considered as paired vectors and the Wilcoxon signed rank test is computed. The default is the Wilcoxon rank sum test.
exact
if TRUE, the exact distribution for the test statistic is used to compute the p-value if possible.
correct
if TRUE, a continuity correction is applied to the normal approximation for the p-value.
print.object.p
if TRUE, the result of the test is printed.

VALUE:

a list with class attribute "htest", representing the result of the Wilcoxon rank sum or Wilcoxon signed rank test. See the help file for wilcox.test for details.

SEE ALSO:

, .