项目作者: msn0

项目描述 :
:chart_with_upwards_trend: Calculate n-th percentile
高级语言: JavaScript
项目地址: git://github.com/msn0/stats-percentile.git
创建时间: 2015-04-23T09:23:03Z
项目社区:https://github.com/msn0/stats-percentile

开源协议:

下载


Percentile Build Status

Calculate n-th percentile

Installation

  1. npm install stats-percentile

Example 1

  1. import percentile from 'stats-percentile';
  2. // calculate p75
  3. percentile(
  4. [3, 6, 7, 8, 8, 10, 13, 15, 16, 20],
  5. 75
  6. ); // → 15

Example 2

  1. const percentile = require('stats-percentile');
  2. function p95() {
  3. return data => percentile(data, 95);
  4. }
  5. p95([
  6. 10, 13, 15, 16, 20, 3, 6, 7, 7, 15, 19, 13,
  7. 13, 8, 19, 35, 22, 17, 19, 19, 12, 21, 9, 9, 12
  8. ]); // → 22

More info

See Nearest Rank Method

License

MIT © Michał Jezierski