當前位置: 首頁>>代碼示例 >>用法及示例精選 >>正文


R語言 pwilcox()用法及代碼示例


pwilcox()R 語言中的函數用於計算一係列數值上 Wilcoxonrank 和統計分布的累積密度函數 (CDF) 的值。

用法: pwilcox(x, m, n)

參數:
x:數字向量
m:更大的樣本量
n:較小的樣本量

範例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)

輸出:

相關用法


注:本文由純淨天空篩選整理自nidhi_biet大神的英文原創作品 Compute the value of CDF over Wilcoxon Rank Sum Distribution in R Programming – pwilcox() Function。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。