当前位置: 首页>>代码示例 >>用法及示例精选 >>正文


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。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。