在 R 编程中计算 CDF 在 Wilcoxon Signedrank 分布上的值 – psignrank()函数
R 语言中的psignrank()
函数用于计算一系列数值的 Wilcoxon Signedrank 统计分布上的累积密度函数(CDF) 的值。
Syntax: psignrank(x, n)
Parameters:
x: Numeric Vector
n: Sample Size
示例 1:
# R Program to compute the value of
# CDF over Wilcoxon Signedrank Distribution
# Creating a sequence of x-values
x <- seq(0, 20, by = 1)
# Calling psignrank() Function
y <- psignrank(x, n = 10)
y
输出:
[1] 0.0009765625 0.0019531250 0.0029296875 0.0048828125 0.0068359375
[6] 0.0097656250 0.0136718750 0.0185546875 0.0244140625 0.0322265625
[11] 0.0419921875 0.0527343750 0.0654296875 0.0800781250 0.0966796875
[16] 0.1162109375 0.1376953125 0.1611328125 0.1875000000 0.2158203125
[21] 0.2460937500
示例 2:
# R Program to compute the value of
# CDF over Wilcoxon Signedrank Distribution
# Creating a sequence of x-values
x <- seq(1, 100, by = 1)
# Calling psignrank() Function
y <- psignrank(x, n = 15)
# Plot a graph
plot(y)
输出: