quants function

quants used in apply to estimate quantiles across a vector