Package 'pci'

Title: A Collection of Process Capability Index Functions
Description: A collection of process capability index functions, such as C_p(), C_pk(), C_pm(), and others, along with metadata about each, like 'LaTeX' equations and 'R' expressions. Its primary purpose is to form a foundation for other quality control packages to build on top of, by providing basic resources and functions. The indices belong to the field of statistical quality control, and quantify the degree to which a manufacturing process is able to create items that adhere to a certain standard of quality. For details see Montgomery, D. C. (2019, ISBN:978-1-119-39930-8).
Authors: Sam Semegne [aut, cre]
Maintainer: Sam Semegne <[email protected]>
License: GPL-3
Version: 1.0.1
Built: 2025-02-28 04:47:18 UTC
Source: https://github.com/samsemegne/pci

Help Index


CpC_p

Description

Cp=USLLSLLσC_p = \frac{\text{USL} - \text{LSL}}{L \sigma}

Only vectors of length 1 are recycled.

NA's take precedence over NaN's, e.g. NaN + NA will output NA.

Yields NaN if sigma equals 0.

Usage

C_p(sigma, lsl, usl, dl)

Arguments

sigma

numeric.

lsl

numeric.

usl

numeric.

dl

numeric. LL, conventionally set to 6. Must be greater than 0.

Value

double.

References

Montgomery, D. C. (2019). Introduction to statistical quality control (8th ed.). Wiley. ISBN: 978-1-119-39930-8

Examples

set.seed(1L)
data = rnorm(n = 30L, mean = 3., sd = 1.)
C_p(sigma = sd(data), lsl = 0., usl = 6., dl = 6.)
# [1] 1.08211

CpkC_{pk}

Description

Cpk=min(Cpl,Cpu)C_{pk} = \min(C_{pl}, C_{pu})

Note. This function allows for negative CpkC_{pk} values.

Only vectors of length 1 are recycled.

NA's take precedence over NaN's, e.g. NaN + NA will output NA.

Yields NaN if sigma equals 0.

Usage

C_pk(mu, sigma, lsl, usl, dl)

Arguments

mu

numeric.

sigma

numeric.

lsl

numeric.

usl

numeric.

dl

numeric. Conventionally set to 6. Must be greater than 0.

Value

double.

References

Montgomery, D. C. (2019). Introduction to statistical quality control (8th ed.). Wiley. ISBN: 978-1-119-39930-8

See Also

C_pl(), C_pu()

Examples

set.seed(1L)
data = rnorm(n = 30L, mean = 3., sd = 1.)
C_pk(mu = mean(data), sigma = sd(data), lsl = 0., usl = 6., dl = 6.)
# [1] 1.052367

CplC_{pl}

Description

Cpl=μLSLLσC_{pl} = \frac{\mu - \text{LSL}}{L \sigma}

Note. This function allows for negative CplC_{pl} values.

Only vectors of length 1 are recycled.

NA's take precedence over NaN's, e.g. NaN + NA will output NA.

Yields NaN if sigma equals 0.

Usage

C_pl(mu, sigma, lsl, l)

Arguments

mu

numeric.

sigma

numeric.

lsl

numeric.

l

numeric. Conventionally set to 3. Must be greater than 0.

Value

double.

References

Montgomery, D. C. (2019). Introduction to statistical quality control (8th ed.). Wiley. ISBN: 978-1-119-39930-8

See Also

C_pu(), C_pk()

Examples

set.seed(1L)
data = rnorm(n = 30L, mean = 3., sd = 1.)
C_pl(mu = mean(data), sigma = sd(data), lsl = 0., l = 3.)
# [1] 1.111853

CpmC_{pm}

Description

Cpm=USLLSLLσ2+(μT)2C_{pm} = \frac{\text{USL} - \text{LSL}}{L \sqrt{\sigma^2 + (\mu - T)^2}}

Only vectors of length 1 are recycled.

NA's take precedence over NaN's, e.g. NaN + NA will output NA.

Yields NaN if sigma == 0 and mu == target.

Usage

C_pm(mu, sigma, target, lsl, usl, dl)

Arguments

mu

numeric.

sigma

numeric.

target

numeric. TT.

lsl

numeric.

usl

numeric.

dl

numeric. LL, conventionally set to 6. Must be greater than 0.

Value

double.

References

Montgomery, D. C. (2019). Introduction to statistical quality control (8th ed.). Wiley. ISBN: 978-1-119-39930-8

Examples

set.seed(1L)
data = rnorm(n = 30L, mean = 3., sd = 1.)
C_pm(mu = mean(data), sigma = sd(data), target = 3., lsl = 0., usl = 6., dl = 6.)
# [1] 1.077827

CpuC_{pu}

Description

Cpu=USLμLσC_{pu} = \frac{\text{USL} - \mu}{L \sigma}

Note. This function allows for negative CpuC_{pu} values.

Only vectors of length 1 are recycled.

NA's take precedence over NaN's, e.g. NaN + NA will output NA.

Yields NaN if sigma equals 0.

Usage

C_pu(mu, sigma, usl, l)

Arguments

mu

numeric.

sigma

numeric.

usl

numeric.

l

numeric. Conventionally set to 3. Must be greater than 0.

Value

double.

References

Montgomery, D. C. (2019). Introduction to statistical quality control (8th ed.). Wiley. ISBN: 978-1-119-39930-8

See Also

C_pl(), C_pk()

Examples

set.seed(1L)
data = rnorm(n = 30L, mean = 3., sd = 1.)
C_pu(mu = mean(data), sigma = sd(data), usl = 6., l = 3.)
# [1] 1.052367

pci_info

Description

Metadata about the process capability indices (PCIs).

Format

pci_info

pci_id

character. The ID of the PCI. Corresponds to the row name of the data.frame in R.

name_r

character. The variable name of the PCI, as may be referred to by other metadata fields that contain R code.

name_latex

character. The name of the PCI in LaTeX format.

name_r_expr

character. The name of the PCI in R expression format, useful for working with plot labels or texts in R. To be used with str2expression(text) in R.

expr_r

character. An R expression of the PCI, in expanded form. Variable names match parameter names of the PCI's function provided by the package. Can be used with str2expression(text) in R.

eq_latex

character. An equation of the PCI in LaTeX format.

attributes

AsIs. The attributes column is essentially an unnamed list, thus being a nested data structure. Each element belonging to a PCI is again an unnamed list, which holds the actual attributes for that PCI. Each attribute is a named list. Attributes detail additional technical information about the PCI or its related concepts, e.g. the bounds of the PCI. Note, all information pertains to the PCI's function provided by the package. Each actual attribute has a 'type' (single character) field, may have a 'target' (character) field, followed by fields specific to that attribute type. The 'target' field indicates which entity the attribute belongs to, e.g. the PCI or one of its terms.