Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/65.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何确定R样本中给定值的百分位数_R - Fatal编程技术网

如何确定R样本中给定值的百分位数

如何确定R样本中给定值的百分位数,r,R,假设我有一个向量样本 x为了阐明Taufi的有用链接参考,您可以为ecdf函数指定一个变量,并将其用于反数值的单个或向量计算。例如 cdf <- ecdf(x) cdf(35) [1] 0.6 allx <- cdf(x) allx [1] 0.16 0.24 0.84 0.92 0.08 0.60 0.24 0.60 0.08 0.44 0.32 0.64 0.96 0.16 0.48 0.40 0.32 0.72 0.76 [20] 1.00 0.36 0.68 0.52 0.

假设我有一个向量样本


x为了阐明Taufi的有用链接参考,您可以为
ecdf
函数指定一个变量,并将其用于反数值的单个或向量计算。例如

cdf <- ecdf(x)
cdf(35)
[1] 0.6
allx <- cdf(x)
allx
 [1] 0.16 0.24 0.84 0.92 0.08 0.60 0.24 0.60 0.08 0.44 0.32 0.64 0.96 0.16 0.48 0.40 0.32 0.72 0.76
[20] 1.00 0.36 0.68 0.52 0.84 0.88
cbind(x, allx)
        x allx
 [1,]   2 0.16
 [2,]   3 0.24
 [3,]  68 0.84
 [4,] 253 0.92
 [5,]   1 0.08
 [6,]  35 0.60
 [7,]   3 0.24
 [8,]  35 0.60
 [9,]   1 0.08
[10,]  24 0.44
[11,]   4 0.32
[12,]  36 0.64
[13,] 254 0.96
[14,]   2 0.16
[15,]  28 0.48
[16,]  12 0.40
[17,]   4 0.32
[18,]  54 0.72
[19,]  66 0.76
[20,] 775 1.00
[21,]   6 0.36
[22,]  45 0.68
[23,]  33 0.52
[24,]  68 0.84
[25,]  71 0.88

cdf是的,看这里:这回答了你的问题吗?好的,它生成一个近似值,但是在值重复很多的情况下,我们可能会有问题,但它已经帮助了我,非常感谢。