Learn R Programming

RVAideMemoire (version 0.9-35)

wilcox.rating.signtest: Wilcoxon sign test for ratings

Description

Wrapper for wilcox.signtest with ratings (ordinal response variables).

Usage

wilcox.rating.signtest(x, data, mu = NULL)

Arguments

x
either a formula of the form a ~ b where a gives the data values and b a factor with 2 levels giving the corresponding groups (comparison of two median ratings); or a numeric vector (comparison of one median rating t
data
an optional data frame containing the variables in the formula x (if x is a formula). By default the variables are taken from environment(x). Not used if x is a numeric vector.
mu
theoretical median rating.

Value

See Also

wilcox.rating.test

Examples

Run this code
set.seed(1706)
response <- factor(c(sample(1:4,7,replace=TRUE),sample(3:6,7,replace=TRUE)),
  levels=c("1","2","3","4","5","6"),ordered=TRUE)

# Comparison of 2 samples
fact <- gl(2,7,labels=LETTERS[1:2])
wilcox.rating.signtest(response~fact)

# Comparison to a given value
theo <- "4"
wilcox.rating.signtest(response,mu=theo)

Run the code above in your browser using DataLab