[英]percentile categories in R
I have a dataset similar to the following and I want to categorise my values in high/medium/low based on percentiles.我有一个类似于以下的数据集,我想根据百分位数将我的值分类为高/中/低。 I use the following but I am confused about the 99% and the values above this value.我使用以下值,但我对 99% 和高于此值的值感到困惑。
data(iris)
quantile(iris$Petal.Length, probs = 0.01)# all the values less than 1.149 are low
quantile(iris$Petal.Length, probs = 0.99)# here must be the high-values category
questions:问题:
To make this more clear, here is a graph that shows the 5. and the 95. percentile of body hieght in human.为了更清楚地说明这一点,这里有一张图表,显示了人体身高的 5. 和 95. 百分位数。 It was assigned to three categories as in your example.如您的示例所示,它被分配到三个类别。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.