Reproduces coin::independence_test for a numeric response and
covariate (scalar linear statistic, asymptotic normal reference).
Usage
morie_indep_test(
formula,
data,
alternative = "two.sided",
distribution = "asymptotic"
)
Arguments
- formula
y ~ x.
- data
A data frame.
- alternative
"two.sided" (default), "greater",
"less".
- distribution
"asymptotic" (only; kept for parity).
Value
A list with statistic (standardized) and p.value.
Examples
set.seed(1)
df <- data.frame(y = rnorm(40), g = factor(rep(c("a", "b"), 20)))
str(morie_indep_test(y ~ g, df), max.level = 1)
#> List of 3
#> $ statistic: num 1.06
#> $ p.value : num 0.29
#> $ method : chr "morie independence permutation test"