Skip to contents

Reproduces coin::wilcox_test(y ~ group): the response is rank-transformed (midranks) and the standardized sum of ranks in the second group is referred to the normal (asymptotic) or exact permutation distribution.

Usage

morie_wilcox_test(
  formula,
  data,
  alternative = "two.sided",
  distribution = "asymptotic"
)

Arguments

formula

y ~ group, group a two-level factor.

data

A data frame.

alternative

"two.sided" / "greater" / "less".

distribution

"asymptotic" (default) or "exact".

Value

A list with statistic (standardized Z) and p.value.

Examples

set.seed(1)
df <- data.frame(y = rnorm(40), g = factor(rep(c("a", "b"), 20)))
str(morie_wilcox_test(y ~ g, df), max.level = 1)
#> List of 3
#>  $ statistic: num 0.812
#>  $ p.value  : num 0.417
#>  $ method   : chr "morie Wilcoxon permutation test"