# quality_controls

> A library for of functions for quality control metrics

Latest version **1.0.8** (published 2021-10-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install quality_controls
pnpm add quality_controls
yarn add quality_controls
bun add quality_controls
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.8 |
| Published | 2021-10-19 |
| First published | 2021-10-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 216.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Jacob Shore |
| Maintainers | dew-of-your-youth |
| Keywords | UCL, LCL, control, bounds, quality, controls |

## Links

- npm: https://www.npmjs.com/package/quality_controls
- Repository: https://gitlab.com/jacobshore/quality_controls
- Homepage: https://gitlab.com/jacobshore/quality_controls#readme
- Issues: https://gitlab.com/jacobshore/quality_controls/issues
- npm.io page: https://npm.io/package/quality_controls

## Recent versions

- 1.0.8 (latest) — 2021-10-19
- 1.0.7 — 2021-10-13
- 1.0.6 — 2021-10-13
- 1.0.5 — 2021-10-12
- 1.0.4 — 2021-10-11
- 1.0.3 — 2021-10-11
- 1.0.2 — 2021-10-11
- 1.0.1 — 2021-10-11
- 1.0.0 — 2021-10-11

## README

# 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.

1. Regular control bounds, with include both population and sample datasets.
2. P-Chart formula

### Regular Control Bounds

Here is an example of control bounds for regular population dataset

```javascript
import { DataWithControls } from "quality_controls/dist/DataWithControls";

const myDefects = [/* numbers go here*/]
const myDatasetWithControls = new DataWithControls(myDefects)
```

```javascript
// 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:

```javascript
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

```javascript
import { PercentDataWithControls } from "quality_controls/dist/PercentDataWithControls";

const myDefects = [/* numbers go here*/]
const myPopSizes = [/* numbers go here*/]

const myPChartData = new PercentDataWithControls(myDefects, myPopSizes)
```

### Methods

1. getMeanArr(): Returns an array of number which are the mean.
2. getLowerBoundsArr(): Returns an array of numbers representing the LCL
3. getUpperBoundsArr(): Returns an array of numbers representing the UCL
4. 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

---
_Source: https://npm.io/package/quality_controls · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
