@sukuasoft/stat-js
v1.0.1
Published
It is a lightweight and easy-to-use library for Node.js that offers basic functions essential for simple statistical analysis
Downloads
2
Readme
Stat JS
- It is a lightweight and easy-to-use library for Node.js that offers basic functions essential for simple statistical analysis
Test average
console.log(average([
1, 7, 8, 4,
]))
//result: 5
Test median
console.log(median([
1, 7, 8, 4, 9
]))
//result: 7
Test weighted average
console.log(average_weighted([
1, 23, 3
], [
4,
5, 1
]))
//result: 12.2
Test mode
console.log(mode([
1, 2, 3, 4, 1, 3, 4, 5, 1, 3, 1.2, 1.2, 1.2, 1.2, 3
]))
//result: [3, 1.2]