Sunday 20 May 2007

st.statistics - calculate percentiles from a histogram

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_igeq p*n$. Then, the empirical upper $p$-percentile is between $x_j$ and $x_{j+1}$.

No comments:

Post a Comment