Computes the Kruskal-Wallis rank sum test for each feature.
See the Details section below for further information.
Arguments
- x
matrix
ordata.frame
.- g
a vector or factor object giving the group for the corresponding elements of
x
.
Value
A list containing two elements:
- statistic
A numeric vector, the values of the test statistic
- significance
A numeric vector, the p-values of the selected test
Details
It is a wrapper to row_kruskalwallis
function.
Examples
#Seed
set.seed(1010)
#Data
x = matrix(rnorm(100 * 20), 100, 20)
g = sample(c(0,1), 20, replace = TRUE)
#Compute
rowKruskalWallis(x = x, g = g)
#> $statistic
#> [1] 0.076923077 0.692307692 3.467817896 0.039246468 1.709576138 0.353218210
#> [7] 0.014128728 0.001569859 0.039246468 0.001569859 3.769230769 7.474097331
#> [13] 0.014128728 0.692307692 7.913657771 0.265306122 0.001569859 6.632653061
#> [19] 0.265306122 0.566718995 0.692307692 0.001569859 0.453689168 0.127158556
#> [25] 2.149136578 4.409733124 0.039246468 3.178963893 0.265306122 1.144427002
#> [31] 0.453689168 1.144427002 1.320251177 0.127158556 0.127158556 5.464678179
#> [37] 0.039246468 1.320251177 0.566718995 1.144427002 0.014128728 0.830455259
#> [43] 0.265306122 1.709576138 5.100470958 0.076923077 0.001569859 0.001569859
#> [49] 2.149136578 0.981161695 2.638932496 0.039246468 0.981161695 0.353218210
#> [55] 0.189952904 1.709576138 0.981161695 0.189952904 1.320251177 0.189952904
#> [61] 0.001569859 0.039246468 0.127158556 0.189952904 0.566718995 0.076923077
#> [67] 0.265306122 0.353218210 1.320251177 0.001569859 2.902668760 3.178963893
#> [73] 0.566718995 0.566718995 1.320251177 0.076923077 2.387755102 1.508634223
#> [79] 0.001569859 0.692307692 2.387755102 6.632653061 1.320251177 0.001569859
#> [85] 0.039246468 1.144427002 0.265306122 0.189952904 1.508634223 0.014128728
#> [91] 3.178963893 0.353218210 1.144427002 0.127158556 0.127158556 0.076923077
#> [97] 0.453689168 0.353218210 2.387755102 0.039246468
#>
#> $significance
#> [1] 0.781511295 0.405380556 0.062573805 0.842961182 0.191040374 0.552297008
#> [7] 0.905382844 0.968394932 0.842961182 0.968394932 0.052203635 0.006259294
#> [13] 0.905382844 0.405380556 0.004906297 0.606497989 0.968394932 0.010012603
#> [19] 0.606497989 0.451565654 0.405380556 0.968394932 0.500588214 0.721396531
#> [25] 0.142650092 0.035734431 0.842961182 0.074592015 0.606497989 0.284718820
#> [31] 0.500588214 0.284718820 0.250546977 0.721396531 0.721396531 0.019404627
#> [37] 0.842961182 0.250546977 0.451565654 0.284718820 0.905382844 0.362140919
#> [43] 0.606497989 0.191040374 0.023919348 0.781511295 0.968394932 0.968394932
#> [49] 0.142650092 0.321912170 0.104273588 0.842961182 0.321912170 0.552297008
#> [55] 0.662955818 0.191040374 0.321912170 0.662955818 0.250546977 0.662955818
#> [61] 0.968394932 0.842961182 0.721396531 0.662955818 0.451565654 0.781511295
#> [67] 0.606497989 0.552297008 0.250546977 0.968394932 0.088433030 0.074592015
#> [73] 0.451565654 0.451565654 0.250546977 0.781511295 0.122289126 0.219347610
#> [79] 0.968394932 0.405380556 0.122289126 0.010012603 0.250546977 0.968394932
#> [85] 0.842961182 0.284718820 0.606497989 0.662955818 0.219347610 0.905382844
#> [91] 0.074592015 0.552297008 0.284718820 0.721396531 0.721396531 0.781511295
#> [97] 0.500588214 0.552297008 0.122289126 0.842961182
#>