I am trying to use ecdf, but I am not sure if I am doing it right. My ultimate purpose is to find what quantile corresponds to a specific value. As an example:
sample_set <- c(20, 40, 60, 80, 100)
# Now I want to get the 0.75 quantile:
quantile(x = sample_set, probs = 0.75)
#result:
75%
80
# Let's use ecdf
ecdf(x = sample_set) (80)
#result
0.8
Why is there this discrepancy? Am I doing some trivial mistake, or it depends on the way quantile makes its calculations?
Thanks, Max