rnorm(n,mean=0,sd=1) # 高斯(正态)
常见的数据描述性分析
中位数median())
百分位数quantile()
> x1=round(rnorm(10,mean=80,sd=30))
> x1
[1] 45 68 65 79 132 83 41 83 51 84
> quantile(x1)
0% 25% 50% 75% 100%
41.0 54.5 73.5 83.0 132.0
> quantile(x1,probs = seq(0,1,0.2))
0% 20% 40% 60% 80% 100%
41.0 49.8 66.8 80.6 83.2 132.0
五数总括
中位数3,下四分位数,上四分位数,最小值,最大值
> fivenum(x1,na.rm=TRUE)
[1] 41.0 51.0 73.5 83.0 132.0
> x1
[1] 45 68 65 79 132 83 41 83 51 84