For the nearest rank computation, you could use the following:
$score_representing_95th_percentile = $arr[round((95/100) * count($arr) -
echo $score_representing_95th_percentile; // 90
That said, there are many ways to calculate percentile (I tend to think in
Z-scores, myself), and nearest rank has its issues, depending on your needs:
<http://en.wikipedia.org/wiki/Percentile>Hopefully the example and the link
give you enough to get what you need working.
On Sat, Jan 29, 2011 at 11:15 AM, Paul Halliday <paul.halli...@gmail.com>wrote:
> What is the quickest way to do this? Will stats_stat_percentile work?
> If so, does anyone have examples of its operation?
> Keep in mind that my math is terrible. Use small words :)
> Paul Halliday
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
Nephtali: A simple, flexible, fast, and security-focused PHP framework