Package Exports
- rj-basic-stats
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (rj-basic-stats) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
rj-basic-stats
We can use statistical operation like mean,mode,median,variance, etc
How to install
npm i rj-basic-statsHow to use
If we want to perforam statistical operation on number array
const stats=require('rj-basic-stats')
const numArray = [1, 5, 3, 4, 2, 6, 8];
const numResult=stats.CalNumModal(numArray);
if input data is population then use true as second parameter
eg: const numResult=stats.CalNumModal(numArray,true);
Here numResult will have object values like isValid, minValue, maxValue, sum, median, mean, mode, variance, standardDeviation, standardError.
If we want only single value then we can that too
eg: const numMean=stats.CalNumModal(numArray).mean;If we want to perforam statistical operation on object array
const stats=require('rj-basic-stats')
const objData = [{ id: 1, name: 'Abc', age: 24 }, { id: 2, name: 'Bob', age: 38 }, { id: 3, name: 'Mack', age: 30 }, { id: 4, name: 'Joe', age: 34 }]
const objResult=stats.CalObjModal(objData,nameOfNumberColumn);
here nameOfNumberColumn is age so it will be const objResult=stats.CalObjModal(objData,'age');
if input data is population then use true as third parameter
eg: const objResult=stats.CalObjModal(objData,'age',true));
Here objResult will have object values like isValid, minValue, maxValue, sum, median, mean, mode, variance, standardDeviation, standardError.
If we want only single value then we can that too
eg: const numMean=stats.CalObjModal(numArray).mean;