在 R 编程中计算 PDF 在 Wilcoxon 秩和分布上的值 – dwilcox()函数
R 语言中的dwilcox()
函数用于计算一系列数值上 Wilcoxonrank Sum Statistic Distribution 的概率密度函数(PDF) 的值。
Syntax: dwilcox(x, m, n)
Parameters:
x: Numeric Vector
m: Larger sample size
n: Smaller sample size
示例 1:
# R Program to compute the value of
# PDF over Wilcoxonrank Sum Distribution
# Creating a sequence of x-values
x <- seq(1, 10, by = 1)
# Calling dwilcox() Function
y <- dwilcox(x, m = 10, n = 5)
y
输出:
[1] 0.0003330003 0.0006660007 0.0009990010 0.0016650017 0.0023310023
[6] 0.0033300033 0.0043290043 0.0059940060 0.0076590077 0.0099900100
示例 2:
# R Program to compute the value of
# PDF over Wilcoxonrank Sum Distribution
# Creating a sequence of x-values
x <- seq(1, 50, by = 1)
# Calling dwilcox() Function
y <- dwilcox(x, m = 30, n = 10)
# Plot a graph
plot(y)
输出: