Learn R Programming

PASWR (version 1.0)

wilcoxE.test: Wilcox Exact Test

Description

Performs exact one sample and two sample Wilcoxon tests on vectors of data.

Usage

wilcoxE.test(x, y = NULL, mu = 0, paired = FALSE,
alternative = "two.sided", conf.level = 0.95)

Arguments

x
is a numeric vector of data values. Non-finite (i.e. infinite or missing) values will be omitted.
y
an optional numeric vector of data values
mu
a number specifying an optional parameter used to form the null hypothesis
paired
a logical indicating whether you want a paired test
alternative
a character string specifying the alternative hypothesis, must be one of "two.sided" (default), "greater", or "less". The initial letter only may be given.
conf.level
confidence level of the interval

Value

  • A list with class htest containing the following components:
  • statisticthe value of the test statistic with a name describing it
  • p.valuethe p-value for the test
  • null.valuethe location parameter mu
  • alternativea character string describing the alternative hypothesis
  • methodthe type of test applied
  • data.namea character string giving the names of the data
  • conf.inta confidence interval for the location parameter
  • estimatean estimate of the location parameter

Details

If only x is given, or if both x and y are given and paired="TRUE", a Wilcoxon signed rank test of the null hypothesis that the distribution of x (in the one sample case) or of x - y (in the paired two sample case) is symmetric about mu is performed. Otherwise, if both x and y are given and paired="FALSE", a Wilcoxon rank sum test is done. In this case, the null hypothesis is that the distributions of x and y differ by a location shift of mu and the alternative is that they differ by some other location shift (and the one-sided alternative "greater" is that x is shifted to the right of y).

References

Gibbons, J.D. and Chakraborti, S. (1992). Nonparametric Statistical Inference. Marcel Dekker Inc., New York. Myles Hollander & Douglas A. Wolfe (1999), Nonparametric Statistical Inference. New York: John Wiley & Sons.

See Also

wilcox.test

Examples

Run this code
# Wilcoxon Signed Rank Test - Example 10.3
PH <- c(7.2,7.3,7.3,7.4)
wilcoxE.test(PH, mu=7.25, alternative="greater")
# Wilcoxon Signed Rank Test (Dependent Samples) - Example 10.5 part c.
attach(Aggression)
wilcoxE.test(violence,noviolence,paired=TRUE,alternative="greater")
detach(Aggression)
# Wilcoxon Rank Sum Test - Example 10.7
x <- c(7.2,7.2,7.3,7.3)
y <- c(7.3,7.3,7.4,7.4)
wilcoxE.test(x,y)

Run the code above in your browser using DataLab