Learn R Programming

pseudorank (version 1.0.4)

kruskal_wallis_test: Kruskal-Wallis Test

Description

This function calculates the Kruskal-Wallis test using pseudo-ranks under the null hypothesis H0F: F_1 = ... F_k.

Usage

kruskal_wallis_test(x, ...)

# S3 method for numeric kruskal_wallis_test(x, grp, na.rm = FALSE, pseudoranks = TRUE, ...)

# S3 method for formula kruskal_wallis_test(formula, data, na.rm = FALSE, pseudoranks = TRUE, ...)

Value

Returns an object of class 'pseudorank'

Arguments

x

numeric vector containing the data

...

further arguments are ignored

grp

factor specifying the groups

na.rm

a logical value indicating if NA values should be removed

pseudoranks

logical value indicating if pseudo-ranks or ranks should be used

formula

optional formula object

data

optional data.frame of the data

References

Brunner, E., Bathke, A.C., and Konietschke, F. (2018a). Rank- and Pseudo-Rank Procedures for Independent Observations in Factorial Designs - Using R and SAS. Springer Series in Statistics, Springer, Heidelberg. ISBN: 978-3-030-02912-8.

Examples

Run this code
x = c(1, 1, 1, 1, 2, 3, 4, 5, 6)
grp = as.factor(c('A','A','B','B','B','D','D','D','D'))

# calculate Kruskal-Wallis test using pseudo-ranks
kruskal_wallis_test(x, grp, na.rm = FALSE, pseudoranks = TRUE)

Run the code above in your browser using DataLab