Skip to contents

Computes the two-sample Wilcoxon test for each feature.

See the Details section below for further information.

Usage

rowWilcoxonT(
  x,
  g,
  alternative = c("two.sided", "greater", "less"),
  null = 0,
  exact = NA,
  correct = TRUE
)

Arguments

x

matrix or data.frame.

g

a vector or factor object giving the group for the corresponding elements of x.

alternative

character string or vector of length nrow(x). The alternative hypothesis for each row of x. Values must be one of "two.sided" (default), "greater" or "less".

null

numerical value or numeric vector of length nrow(x). The true values of the difference in means between the two groups of observations for each row.

exact

logical or NA (default) indicator whether an exact p-value should be computed (see Details). A single value or a logical vector with values for each observation.

correct

logical indicator whether continuity correction should be applied in the cases where p-values are obtained using normal approximation. A single value or logical vector with values for each observation.

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_wilcoxon_twosample function.

Author

Alessandro Barberis

Examples

#Seed
set.seed(1010)

#Data
x = matrix(rnorm(100 * 20), 100, 20)
g = sample(c(0,1), 20, replace = TRUE)

#Compute
rowWilcoxonT(x = x, g = g)
#> $statistic
#>   [1] 49 56 22 43 29 53 47 45 48 46 70 80 47 56 10 52 46 78 39 36 35 46 54 41 64
#>  [26] 19 43 68 52 59 54 32 31 41 50 16 43 60 36 59 47 34 52 29 17 49 46 45 27 33
#>  [51] 25 48 58 38 40 62 58 40 31 51 46 43 41 40 55 49 52 38 60 45 67 68 36 36 60
#>  [76] 49 65 30 45 35 26 78 31 45 48 59 39 51 61 47 23 38 59 50 50 49 54 38 26 48
#> 
#> $significance
#>   [1] 0.816795666 0.437796698 0.067492260 0.877296182 0.210603715 0.588028896
#>   [7] 0.938467492 1.000000000 0.877296182 1.000000000 0.055675955 0.004669763
#>  [13] 0.938467492 0.437796698 0.003405573 0.642647059 1.000000000 0.008462332
#>  [19] 0.642647059 0.485423117 0.437796698 1.000000000 0.535552116 0.757301342
#>  [25] 0.157430341 0.036945304 0.877296182 0.081114551 0.642647059 0.311377709
#>  [31] 0.535552116 0.311377709 0.274922601 0.757301342 0.757301342 0.018601651
#>  [37] 0.877296182 0.274922601 0.485423117 0.311377709 0.938467492 0.392879257
#>  [43] 0.642647059 0.210603715 0.023606811 0.816795666 1.000000000 1.000000000
#>  [49] 0.157430341 0.350696594 0.114628483 0.877296182 0.350696594 0.588028896
#>  [55] 0.699174407 0.210603715 0.350696594 0.699174407 0.274922601 0.699174407
#>  [61] 1.000000000 0.877296182 0.757301342 0.699174407 0.485423117 0.816795666
#>  [67] 0.642647059 0.588028896 0.274922601 1.000000000 0.096800826 0.081114551
#>  [73] 0.485423117 0.485423117 0.274922601 0.816795666 0.134803922 0.241357069
#>  [79] 1.000000000 0.437796698 0.134803922 0.008462332 0.274922601 1.000000000
#>  [85] 0.877296182 0.311377709 0.642647059 0.699174407 0.241357069 0.938467492
#>  [91] 0.081114551 0.588028896 0.311377709 0.757301342 0.757301342 0.816795666
#>  [97] 0.535552116 0.588028896 0.134803922 0.877296182
#>