math-stats
v0.4.1
Published
Statistics for your numbers
Downloads
209
Maintainers
Readme
Stats
A small library that does statistics for your numbers.
Installation
npm install math-stats
Usage
var stats = require('@pavanvamsi/math-stats');
var numbers = [1, 2, 3];
var moreNumbers = [1, 2, 1, 3];
var mean = stats.mean(numbers); // returns 2
var median = stats.median(numbers); // returns 2
var modes = stats.mode(moreNumbers); // returns [1]
var modeOfStrings = stats.mode(['red', 'blue', 'red']); // returns ['red']
var standardDeviation = stats.standardDeviation(numbers); // returns 0.816496580927726
var variance = stats.variance(numbers); // returns 0.6666666666666666
var harmonicMean = stats.harmonicMean(numbers); // returns 1.6363636363636365
var geometricMean = stats.geometricMean(numbers); // returns 1.8171205928321397
Like it? :see_no_evil:
:star: the repo and share.
License
MIT Copyright (c) pavanvamsi