在 R 编程中计算随机绘制的 Wilcoxon Signedrank 密度 – rsignrank()函数
R 语言中的rsignrank()
函数用于计算 Wilcoxon Signedrank 统计分布在一系列随机数值上的随机密度。
Syntax: rsignrank(N, n)
Parameters:
N: Size of Random Vector
n: Sample Size
示例 1:
# R Program to compute random
# Wilcoxon Signedrank Density
# Setting seed for
# random number generation
set.seed(1000)
# Set Vector size
N <- 20
# Calling rsignrank() Function
y <- rsignrank(N, n = 10)
y
输出:
[1] 26 29 21 36 43 42 31 8 8 25 33 19 31 24 39 48 38 39 24 38
示例 2:
# R Program to compute random
# Wilcoxon Signedrank Density
# Setting seed for
# random number generation
set.seed(1000)
# Set Vector size
N <- 100
# Calling rsignrank() Function
y <- rsignrank(N, n = 10)
# Plot a graph
plot(y)
输出: