wilcox.signtest: Wilcoxon sign test

wilcox.signtestR Documentation

Wilcoxon sign test

Description

Performs a Wilcoxon sign test to compare medians of two paired samples or one median to a given value.

Usage


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, ...)

Arguments

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 x-y differences.

conf.level

confidence level of the interval.

formula

a formula of the form a ~ b, where a and b give the data values and corresponding groups.

data

an optional data frame containing the variables in the formula formula. By default the variables are taken from environment(formula).

subset

an optional vector specifying a subset of observations to be used.

...

further arguments to be passed to or from other methods.

Details

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.

Value

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 "two.sided"

estimate

the estimated median or median of x-y differences, depending on the test performed.

conf.int

a confidence interval for the median tested.

Author(s)

Maxime HERVE <maxime.herve@univ-rennes1.fr>

See Also

wilcox.test

Examples

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)

RVAideMemoire documentation built on Nov. 6, 2023, 5:07 p.m.