1.0.8 • Published 3 years ago
quality_controls v1.0.8
Quality Controls
A Library for Calculating UCL and LCL Bounds
This is simple library for calculating quality controls bounds. Currently there are 2 types of formulas.
- Regular control bounds, with include both population and sample datasets.
- P-Chart formula
Regular Control Bounds
Here is an example of control bounds for regular population dataset
import { DataWithControls } from "quality_controls/dist/DataWithControls";
const myDefects = [/* numbers go here*/]
const myDatasetWithControls = new DataWithControls(myDefects)
// or like this:
const myDatasetWithControls = new DataWithControls(myDefects, "population")
// or like this
const myDatasetWithControls = new DataWithControls(myDefects, 0)
To change the dataset type from a population to a sample you would set it like this:
const mySampleDatasetWithControls = new DataWithControls(myDefects, "sample")
// or like this:
const mySampleDatasetWithControls = new DataWithControls(myDefects, 1)
P-Chart Control Bounds
For application of P-Chart Control Bounds you also need an array of numbers representing the population size
import { PercentDataWithControls } from "quality_controls/dist/PercentDataWithControls";
const myDefects = [/* numbers go here*/]
const myPopSizes = [/* numbers go here*/]
const myPChartData = new PercentDataWithControls(myDefects, myPopSizes)
Methods
- getMeanArr(): Returns an array of number which are the mean.
- getLowerBoundsArr(): Returns an array of numbers representing the LCL
- getUpperBoundsArr(): Returns an array of numbers representing the UCL
- getData(): returns an object with arrays of relevant data:
- defects: An array the count of defects
- mean: an array of number which are the mean.
- upperBounds: an array of numbers representing the UCL
- lowerBounds: an array of numbers representing the LCL
- populationSizes: ONLY for P-Charts an array of numbers representing the population sizes
- percent: ONLY for P-Charts an array of numbers representing the defects as a percent