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


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


dsignrank()R語言中的函數用於計算一係列數值的威爾科克森符號秩統計分布上的概率密度函數(PDF)的值。

用法: dsignrank(x, n)

參數:
x:數字向量
n:樣本量

範例1:


# R Program to compute the value of
# PDF over Wilcoxon Signedrank Distribution
  
# Creating a sequence of x-values
x <- seq(0, 20, by = 1)
  
# Calling dsignrank() Function
y <- dsignrank(x, n = 10)
y

輸出:

 [1] 0.0009765625 0.0009765625 0.0009765625 0.0019531250 0.0019531250
 [6] 0.0029296875 0.0039062500 0.0048828125 0.0058593750 0.0078125000
[11] 0.0097656250 0.0107421875 0.0126953125 0.0146484375 0.0166015625
[16] 0.0195312500 0.0214843750 0.0234375000 0.0263671875 0.0283203125
[21] 0.0302734375

範例2:


# R Program to compute the value of
# PDF over Wilcoxon Signedrank Distribution
  
# Creating a sequence of x-values
x <- seq(1, 100, by = 1)
  
# Calling dsignrank() Function
y <- dsignrank(x, n = 15)
  
# Plot a graph
plot(y)

輸出:

相關用法


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