Computes the randomization null distribution of a single rank sum statistic under complete randomization.
Usage
null_dist(
n,
m,
method.list = NULL,
score = NULL,
nperm = 10^5,
Z.perm = NULL,
chunk_size = 1000
)Arguments
- n
Total number of units.
- m
Number of treated units.
- method.list
A list specifying the scoring method.
- score
Optional pre-computed score vector.
- nperm
Number of permutations.
- Z.perm
Optional pre-computed permutation matrix.
- chunk_size
Integer chunk size used to generate permutations when
Z.permisNULL. Smaller values use less memory.
Examples
set.seed(1)
score <- rank_score(20, list(name = "Wilcoxon", scale = FALSE))
nd <- null_dist(n = 20, m = 12, score = score, nperm = 500)
quantile(nd, c(0.5, 0.95))
#> 50% 95%
#> 127.00 148.05