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


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


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

用法: psignrank(x, n)

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

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

輸出:

相關用法


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