## calculate percentiles from a histogram [closed]

Hi,

Could someone explain to me or point out some documentation on how to compute a given percentile from a histogram ?

-
rantravee- MathOverflow is intended for questions above the level of HW for early undergraduate courses, so I've closed this question. There are links to other internet fora which might be more appropriate in the FAQ mathoverflow.net/faq#homework – Ben Webster Feb 7 2010 at 18:29

## closed as too localized by Ben Webster♦Feb 7 2010 at 18:27

A histogram gives you the number $n_i$ of observations between some $x_i$ and $x_{i+1}$. I'm assuming a total of $n$ observation. So, to get an approximation for the upper $p$-percentile, you want to find the maximal $j$ such that $\sum_{i=j}^\infty n_i\geq p*n$. Then, the empirical upper $p$-percentile is between $x_j$ and $x_{j+1}$.
 Thanks, I think I got it ! – rantravee Feb 7 2010 at 10:56 A trivial tip on LaTeX: Please don't use the asterisk to indicate multiplication. It looks like convolution to most mathematicians. Use \cdot instead (as in $p\cdot n$). And since the original question was on histograms: A good way to visualize the process is to stack the columns of the histogram on top of each other. Then just mark the point at a fraction p of the full height from the bottom. The p -percentile corresponds to the column you just marked. – Harald Hanche-Olsen Feb 7 2010 at 15:47 Histograms come in two forms. The other kind, for when the data measured belongs to a discrete set of values, gives you the number $n_i$ of observations equal to $x_i$. In which case the answer is a bit more subtle. – Harald Hanche-Olsen Feb 7 2010 at 15:52