Skip to contents

Performs Kruskal-Wallis test on samples.

Super classes

LearnNonparam::PermuTest -> LearnNonparam::KSampleTest -> KruskalWallis

Methods

Public methods

Inherited methods


Method new()

Create a new KruskalWallis object.

Usage

KruskalWallis$new(
  type = c("permu", "asymp"),
  scoring = c("rank", "vw", "expon"),
  n_permu = 10000
)

Arguments

type

a character string specifying the way to calculate the p-value.

scoring

a character string specifying the scoring system.

n_permu

an integer indicating number of permutations for the permutation distribution. If set to 0, all permutations will be used.

Returns

A KruskalWallis object.

Examples

pmt(
    "ksample.kw", type = "asymp"
)$test(Table3.2.2)$print()
#> 
#>  	 Kruskal-Wallis Test 
#> 
#> scoring: rank    type: asymp    method: default
#> statistic = 17.14286, p-value = 0.0006605027

t <- pmt(
    "ksample.kw", type = "permu"
)$test(Table3.2.3)$print()
#> 
#>  	 Kruskal-Wallis Test 
#> 
#> scoring: rank    type: permu(10000)    method: default
#> statistic = 8.246588, p-value = 0.0119 (± 0.002125309 at 95% confidence)

t$type <- "asymp"
t
#> 
#>  	 Kruskal-Wallis Test 
#> 
#> scoring: rank    type: asymp    method: default
#> statistic = 8.246588, p-value = 0.01619109