Socket
Socket
Sign inDemoInstall

stats-percentile

Package Overview
Dependencies
0
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    stats-percentile

Calculate n-th percentile


Version published
Weekly downloads
36K
decreased by-5.63%
Maintainers
1
Install size
7.36 kB
Created
Weekly downloads
 

Readme

Source

Percentile Build Status

Calculate n-th percentile

Installation

npm install stats-percentile

Example 1

import percentile from 'stats-percentile';

// calculate p75
percentile(
    [3, 6, 7, 8, 8, 10, 13, 15, 16, 20],
    75
); // → 15

Example 2

const percentile = require('stats-percentile');

function p95() {
    return data => percentile(data, 95);
}

p95([
  10, 13, 15, 16, 20, 3, 6, 7, 7, 15, 19, 13,
  13, 8, 19, 35, 22, 17, 19, 19, 12, 21, 9, 9, 12
]); // → 22

More info

See Nearest Rank Method

License

MIT © Michał Jezierski

Keywords

FAQs

Last updated on 21 Jul 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc