在 R 编程中计算 CDF 在 Wilcoxon 秩和分布上的值 – pwilcox()函数
R 语言中的pwilcox()
函数用于计算一系列数值上的 Wilcoxonrank Sum Statistic Distribution 的累积密度函数(CDF) 的值。
Syntax: pwilcox(x, m, n)
Parameters:
x: Numeric Vector
m: Larger sample size
n: Smaller sample size
示例 1:
# R Program to compute the value of
# CDF over Wilcoxonrank Sum Distribution
# Creating a sequence of x-values
x <- seq(1, 10, by = 1)
# Calling pwilcox() Function
y <- pwilcox(x, m = 10, n = 5)
y
输出:
[1] 0.0006660007 0.0013320013 0.0023310023 0.0039960040 0.0063270063
[6] 0.0096570097 0.0139860140 0.0199800200 0.0276390276 0.0376290376
示例 2:
# R Program to compute the value of
# CDF over Wilcoxonrank Sum Distribution
# Creating a sequence of x-values
x <- seq(1, 50, by = 1)
# Calling pwilcox() Function
y <- pwilcox(x, m = 40, n = 20)
# Plot a graph
plot(y)
输出: