在 R 编程中计算随机绘制的 Wilcoxon 秩和密度 – rwilcox()函数
R 语言中的rwilcox()
函数用于计算随机数值序列上 Wilcoxon 秩和统计分布的随机密度。
Syntax: rwilcox(N, m, n)
Parameters:
N: Size of Random Vector
m: Larger sample size
n: Smaller sample size
示例 1:
# R Program to compute random
# Wilcoxonrank Sum Density
# Setting seed for
# random number generation
set.seed(1000)
# Set Vector size
N <- 20
# Calling rwilcox() Function
y <- rwilcox(N, m = 10, n = 5)
y
输出:
[1] 18 21 30 32 12 32 21 24 33 24 26 35 18 27 29 21 13 15 26 31
示例 2:
# R Program to compute random
# Wilcoxonrank Sum Density
# Setting seed for
# random number generation
set.seed(1000)
# Set Vector size
N <- 100
# Calling rwilcox() Function
y <- rwilcox(N, m = 40, n = 10)
# Plot a graph
plot(y)
输出: