# stats-percentile

> Calculate n-th percentile

Latest version **3.3.0** (published 2021-07-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install stats-percentile
pnpm add stats-percentile
yarn add stats-percentile
bun add stats-percentile
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.3.0 |
| Published | 2021-07-21 |
| First published | 2015-04-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8.0.0 |
| Dependencies | 0 |
| Unpacked size | 7.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 13 |
| Author | Michał Jezierski |
| Maintainers | michal.jezierski |
| Keywords | percentile, stats, statistics, analytics |

## Links

- npm: https://www.npmjs.com/package/stats-percentile
- Repository: https://github.com/msn0/stats-percentile
- Issues: https://github.com/msn0/stats-percentile/issues
- npm.io page: https://npm.io/package/stats-percentile

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 3.3.0 (latest) — 2021-07-21
- 3.1.0 — 2018-01-02
- 3.0.0 — 2017-07-15
- 2.0.0 — 2017-05-19
- 1.2.0 — 2016-05-02
- 1.1.0 — 2015-10-18
- 1.0.1 — 2015-04-24
- 1.0.0 — 2015-04-23

## README

# Percentile [![Build Status](https://travis-ci.org/msn0/stats-percentile.svg?branch=master)](http://travis-ci.org/msn0/stats-percentile)

> Calculate n-th percentile

## Installation

```sh
npm install stats-percentile
```

## Example 1

```js
import percentile from 'stats-percentile';

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

## Example 2

```js
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](http://en.wikipedia.org/wiki/Percentile#The_Nearest_Rank_method)

## License

MIT &copy; [Michał Jezierski](https://pl.linkedin.com/in/jezierskimichal)

---
_Source: https://npm.io/package/stats-percentile · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
