wilcox.signtest | R Documentation |
Performs a Wilcoxon sign test to compare medians of two paired samples or one median to a given value.
wilcox.signtest(x, ...)
## Default S3 method:
wilcox.signtest(x, y = NULL, mu = 0, conf.level = 0.95, ...)
## S3 method for class 'formula'
wilcox.signtest(formula, data, subset, ...)
x |
a numeric vector of data values. |
y |
an optional numeric vector of data values (for paired two-sample test). |
mu |
theoretical median (one-sample test) or theoretical median of |
conf.level |
confidence level of the interval. |
formula |
a formula of the form |
data |
an optional data frame containing the variables in the formula |
subset |
an optional vector specifying a subset of observations to be used. |
... |
further arguments to be passed to or from other methods. |
If zeroes (i.e. null differences with mu
) are present, the median of the data different from mu
is tested in the one-sample situation; the median of the x-y
differences different from mu
in the two-sample situation.
method |
a character string indicating the name of the test. |
data.name |
a character string giving the name(s) of the data. |
null.value |
the specified hypothesized value of the median or median difference depending on the test performed. |
p.value |
the p-value of the test. |
alternative |
a character string giving the alternative hypothesis, always |
estimate |
the estimated median or median of |
conf.int |
a confidence interval for the median tested. |
Maxime HERVE <maxime.herve@univ-rennes1.fr>
wilcox.test
set.seed(1706)
response <- c(rnorm(7,3,1.5),rnorm(7,5.5,2))
# Comparison of 2 samples
fact <- gl(2,7,labels=LETTERS[1:2])
wilcox.signtest(response~fact)
# Comparison to a given value
theo <- 4
wilcox.signtest(response,mu=theo)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.