Learn R Programming

matrixTests (version 0.2)

kruskalwallis: Kruskal-Wallis rank sum test

Description

Performs a Kruskal-Wallis rank sum test on each row/column of the input matrix.

Usage

row_kruskalwallis(x, g)

col_kruskalwallis(x, g)

Value

a data.frame where each row contains the results of a Kruskal-Wallis test performed on the corresponding row/column of x.

Each row contains the following information (in order):

1. obs.tot - total number of observations

2. obs.groups - number of groups

4. df - degrees of freedom

5. statistic - chi-squared statistic

6. pvalue - p.value

Arguments

x

numeric matrix.

g

a vector specifying group membership for each observation of x.

Author

Karolis Koncevičius

Details

row_kruskalwallis(x, g) - Kruskal Wallis test on rows. col_kruskalwallis(x, g) - Kruskal Wallis test on columns.

Results should be the same as running kruskal.test(x, g) on every row (or column) of x

See Also

Examples

Run this code
col_kruskalwallis(iris[,1:4], iris$Species)
row_kruskalwallis(t(iris[,1:4]), iris$Species)

Run the code above in your browser using DataLab