Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

math-stats

0.4.0 • Public • Published

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

Tests

npm test

To do

Like it? 🙈

⭐️ the repo and share.

Link to npm package

License

MIT Copyright (c) pavanvamsi

More from the organisation

Install

npm i math-stats

DownloadsWeekly Downloads

7

Version

0.4.0

License

MIT

Unpacked Size

12.4 kB

Total Files

10

Last publish

Collaborators

  • avatar