Learn R Programming

onewaytests (version 1.0)

kw.test: A Function to Perform Kruskal-Wallis Rank Sum Test

Description

kw.test performs Kruskal-Wallis rank sum test.

Usage

kw.test(y, group)

Arguments

y
a numeric vector of data values.
group
a vector or factor object giving the group for the corresponding elements of y.

Value

  • Returns a list containing following elements:
  • statisticthe Kruskal-Wallis rank sum statistic.
  • dfthe degrees of freedom of the approximate chi-squared distribution of the test statistic.
  • p.valuethe p-value of the test.

References

Sheskin, D. J. (2004). Handbook of Parametric and Nonparametric Statistical Procedures. 3rd Edition. Chapman and Hall CRC. Florida: Boca Raton.

Examples

Run this code
kw.test(iris$Sepal.Length,iris$Species)

Run the code above in your browser using DataLab