# 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 ?

-

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

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

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 '10 at 18:29

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}$.
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 '10 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 '10 at 15:52