Learn R Programming

RVAideMemoire (version 0.9-35)

kruskal.rating.test: Kruskal-Wallis rank sum test for ratings

Description

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

Usage

kruskal.rating.test(x, ...)

## S3 method for class 'default':
kruskal.rating.test(x, g, ...)

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

Arguments

x
response variable (preferably an ordered factor).
g
a factor giving the group for the corresponding element of x.
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(1609)
response <- factor(sample(1:6,30,replace=TRUE),levels=c("1","2","3","4","5","6"),ordered=TRUE)
fact <- gl(3,1,30,labels=LETTERS[1:3])
kruskal.rating.test(response~fact)

Run the code above in your browser using DataLab