Performs a sign-flipping paired permutation test on the paired
differences. coin::symmetry_test(distribution = "approximate")
is the canonical CRAN equivalent (cross-referenced); rmorie keeps
the inline path because the rmorie API returns the full null
distribution.
Usage
paired_permutation_test(
x,
y,
statistic = "mean_diff",
n_permutations = 9999L,
alternative = "two-sided",
seed = 42L
)Examples
set.seed(1)
x <- rnorm(25)
str(paired_permutation_test(x, x + rnorm(25, 0.3),
n_permutations = 499L), max.level = 1)
#> List of 7
#> $ observed_statistic: num -0.488
#> $ p_value : num 0.08
#> $ null_distribution : num [1:499] -0.2084 -0.2795 -0.4931 0.0431 0.1884 ...
#> $ n_permutations : int 499
#> $ alternative : chr "two-sided"
#> $ ci_lower : num NA
#> $ ci_upper : num NA
#> - attr(*, "class")= chr [1:2] "morie_permutation_test_result" "list"
