box-plot
v1.0.0
Published
Calculate the parameters for a box plot.
Downloads
305
Readme
box-plot
Calculate the parameters for a box plot.
Install
npm install box-plot
Usage
const boxPlot = require("box-plot")
boxPlot([-15, 1, 2, 4, 3, 5, 8, 6, 7, 9, 10, 25])
//=> { maximum: 10, upperQuartile: 9, median: 5.5, lowerQuartile: 2, minimum: 1 }
API
boxPlot(values)
values
Type: number[]
An array of values to compute the box plot for.
Return value
maximum
Type: number
The largest value that is not an outlier. An outlier is a number that is greater than 1.5x the difference between the upper and lower quartile added to the upper quartile.
upperQuartile
Type: number
The median of the values after the middle number(s).
median
Type: number
The median of all of the values.
lowerQuartile
Type: number
The median of the values before the middle number(s).
minimum
Type: number
The smallest value that is not an outlier. An outlier is a number that is smaller than 1.5x the difference between the upper and lower quartile subtracted from the lower quartile.