An npm package for performing basic statistical analysis.
-
Import the Summary class.
import { Descriptive } from "@snailcode.net/basic-stat"; -
Create a new Summary.
const grades = [1, 2, 4, 6, 9];const stat = new Descriptive("grades", grades, "sample"); -
To access all the descriptive statistics of the dataset, you can access the 'summary' property of the summary.
stat.summaryThe value property contains the mean, median, mode, max, min, variance, and standard deviation of the dataset.
-
You can access the different descriptive statistics individually using the following:
- mean:
stat.summary.mean - median:
stat.summary.median - mode:
stat.summary.mode - max:
stat.summary.max - min:
stat.summary.min - variance:
stat.summary.variance - standard deviation:
stat.summary.standardDeviation
- mean:
in-progress