Learn R Programming

RVAideMemoire (version 0.9-35)

wilcox.rating.test: Wilcoxon rank sum and signed rank tests for ratings

Description

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

Usage

wilcox.rating.test(x, ...)

## S3 method for class 'default':
wilcox.rating.test(x, y = NULL, mu = NULL, ...)

## S3 method for class 'formula':
wilcox.rating.test(formula, data, subset, na.action, ...)

Arguments

x
response variable (preferably an ordered factor).
y
an optional second response variable (preferably an ordered factor) to be compared with x.
mu
a character string giving a theoretical rating to be compared with x in one-sample tests.
formula
a formula of the form a ~ b, where a and b give the data values and corresponding groups. It is preferable that a is an ordered factor.
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.
na.action
a function which indicates what should happen when the data contain NAs. Defaults to getOption("na.action").
...
further arguments to be passed to or from other methods.

Value

Examples

Run this code
set.seed(1719)
response <- factor(sample(1:6,30,replace=TRUE),levels=c("1","2","3","4","5","6"),ordered=TRUE)
fact <- gl(2,15,labels=LETTERS[1:2])
wilcox.rating.test(response~fact)

Run the code above in your browser using DataLab