Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lukem512/statistical-methods
A collection of statistical methods
https://github.com/lukem512/statistical-methods
average deviation mean statistics variance
Last synced: about 8 hours ago
JSON representation
A collection of statistical methods
- Host: GitHub
- URL: https://github.com/lukem512/statistical-methods
- Owner: lukem512
- Created: 2016-04-14T09:01:53.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-07-31T11:47:20.000Z (over 7 years ago)
- Last Synced: 2024-11-14T09:40:56.190Z (6 days ago)
- Topics: average, deviation, mean, statistics, variance
- Language: JavaScript
- Homepage:
- Size: 5.86 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# statistical-methods
[![Build Status](https://travis-ci.org/lukem512/statistical-methods.svg?branch=master)](https://travis-ci.org/lukem512/statistical-methods) ![Build Status](https://david-dm.org/lukem512/statistical-methods.svg) [![npm](https://img.shields.io/npm/l/statistical-methods.svg)](https://www.npmjs.com/package/statistical-methods) [![npm](https://img.shields.io/npm/v/statistical-methods.svg)](https://www.npmjs.com/package/statistical-methods) [![npm](https://img.shields.io/npm/dm/statistical-methods.svg)](https://www.npmjs.com/package/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.
```js
var sm = require('statistical-methods');
```Then, use the following functions to perform statistical analysis on your data.
```js
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)); // 5console.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).
### License
MIT © Luke Mitchell