Reproduces coin::oneway_test(y ~ group): the quadratic-form
permutation analogue of one-way ANOVA, referred to the chi-square
distribution (asymptotic).
Usage
morie_oneway_test(formula, data, distribution = "asymptotic")
Arguments
- formula
y ~ group, group a factor.
- data
A data frame.
- distribution
"asymptotic" (only; kept for parity).
Value
A list with statistic (chi-square), df and
p.value. For a two-level group the standardized scalar
statistic and its normal p-value are returned instead, matching coin.
Examples
set.seed(1)
df <- data.frame(y = rnorm(40), g = factor(rep(c("a", "b"), 20)))
str(morie_oneway_test(y ~ g, df), max.level = 1)
#> List of 4
#> $ statistic: num 1.06
#> $ df : int 1
#> $ p.value : num 0.29
#> $ method : chr "morie one-way permutation test"