Using R language, I was mainly trying to understand if 0.25 quantile means
value < 25 percentage of the values
or
value <= 25 percentage of the values
And similarly for 0.75 quantile
I tried the following code :
test <- c(1, 2, 3, 4, 5, 6, 7, 8)
quantile(test)
0% 25% 50% 75% 100%
1.00 2.75 4.50 6.25 8.00
I'm unable to explain why 25% is 2.75 and not 2 or 2.5 or 3
I checked the documentation https://www.rdocumentation.org/packages/stats/versions/3.6.2/topics/quantile and found there are multiple algorithms used. However I don't really understand type=7, in simple terms. Could someone please explain this ?
I checked this question : Understanding The Algorithms Behind Quantile() in R but example used there seems to be different (meaning it results in a value from the numbers provided). Also based on the answer to that question "and the proportion greater than or equal to qp is at most 1−p", 7 numbers are greater than or equal i.e. 7/9 = 0.778, 1-1/4 = 0.75. 0.778 is not atmost 0.75. So the definition in that answer is not really correct ?