Package Exports
- statistical-methods
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (statistical-methods) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
statistical-methods
This is an NPM module providing a collection of statistical methods including mean, mode, median, range, variance, standard deviation, sum and product.
To use it, simple install via NPM and include it in your project file.
var sm = require('statistical-methods');
Then, use the following functions to perform statistical analysis on your data.
var arr = [ 8, 9, 10, 10, 10, 11, 11, 11, 12, 13];
console.log(sm.mean(arr)); // 10.5
console.log(sm.median(arr)); // 10.5
console.log(sm.mode(arr)); // [10, 11]
console.log(sm.min(arr)); // 8
console.log(sm.max(arr)); // 13
console.log(sm.range(arr)); // 5
console.log(sm.variance(arr)); // 2.0555555555555554,
console.log(sm.stddev(arr)); // 1.4337208778404378,
console.log(sm.sum(arr)); // 105
console.log(sm.prod(arr)); // 14949792000
The expected data format for all functions is an array of numbers (integers or floats).