Skip to content

A small library that does the statistics for your numbers.

License

Notifications You must be signed in to change notification settings

pugulist/math-stats

Repository files navigation

mathematica_logo


Stats Build Status Coverage Status Known Vulnerabilities NPM Downloads Node.js CI

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? 🙈

⭐ the repo and share.

Link to npm package

License

MIT Copyright (c) pavanvamsi