Haha, close threadTake a sorted vector of observations u(i=1 to n) with weights w(i = 1 to n) or weights each equal to one if the sample is unweighted.
Then find i = the first index point that is larger than pn, where p is the proportion of the quantile and n is the sample size.