Reputation: 1012
We have the following vector:
BMI <- c( 24.00568, 46.76243, 23.34254, 47.26230, 14.73006, 14.07006,
18.44512, 15.06024, 21.84091, 38.34783)
I want to know, which quantile is the value 25 and higher.
How can I do it in r?I know, it should be connected with the function quantile
, but i can't figure out the solution.
Upvotes: 0
Views: 251
Reputation: 3739
You can also use the empirical cumulative distribution function ecdf()
.
ecdf(BMI)(25)
Upvotes: 3
Reputation: 2512
This just is the simple average of the number of elements below 25:
mean(BMI<25)
Upvotes: 2