1.0.0 • Published 5 years ago

qquantile v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

quantile

Calculate arbitrary quantiles

Setup

  • Run yarn to bootstrap dependencies

Development

Require and run like so:

const { quantiles, quantileGroups } = require('qquantile')

const data = [3, 6, 7, 8, 8, 10, 13, 15, 16, 20]

quantiles(data, 4)      // returns the q-quantiles, in this case, quartiles
// =>   [7, 9, 15, 20]


quantileGroups(data, 4) // returns the q-quantile groups, in this case, all quartile groups
// =>   [
//          [ 3, 6, 7 ],
//          [ 8, 8 ],
//          [ 10, 13, 15 ],
//          [ 16, 20 ]
//      ]

Testing

  • Run yarn test to run the Jest suite tests