Learn R Programming

qualityTools (version 1.31.1)

pcr: Calculate the process capability ratios for a given dataset and distribution

Description

Calculates the process capability ratios cp, cpk, cpkL and cpkU for a given dataset and distribution. A histogramm with a density curve is displayed along with the specification limits and a Quantile-Quantile Plot for the specified distribution

Usage

pcr(x, distribution = "normal", lsl, usl, target, boxcox = FALSE, lambda, main, xlim, ylim, grouping = NULL, std.dev = NULL, conf.level = 0.9973002, start, lineWidth = 2, lineCol = "red", lineType = "solid", specCol = "black", specWidth = 2, cex.text = 2, cex.val = 1.5, cex.col = "darkgray", ...)

Arguments

x
numeric vector
distribution
character string such as "weibull"
lsl
lower specification limit
usl
upper specification limit
target
target value
boxcox
perform a Box-Cox transformation (default is FALSE)
lambda
lambda for the transformation
main
main
xlim
xlim
ylim
ylim
grouping
grouping vector
std.dev
historical standard devation (only for normal distribution)
conf.level
start
A named list giving the parameters to be fitted with initial values. Must be supplied for some distribution. (see Details)
lineWidth
the width of the line for the density curve
lineCol
the color of the line for the density curve
lineType
the line Type e.g. "dashed", "solid", etc.
specCol
col for the specification limits
specWidth
lwd for the specification limits
cex.text
cex for lsl, usl and target
cex.val
cex for the process capability ratios
cex.col
col for lsl, usl and target
...
other graphical parameters (par)

Details

Distribution fitting is deligated to function fitdistr of the R-package MASS.

See Also

qqPlot, ppPlot

Examples

Run this code
#process capability for a weibull distribution
x = rweibull(30, 2, 8)
pcr(x, "weibull", lsl = 0, usl = 17)

#process capability assuming a normal distribution
pcr(x, "normal", lsl = 0, usl = 17)

Run the code above in your browser using DataLab