qcc | R Documentation |
Create an object of class 'qcc'
to perform statistical quality control. This object may then be used to plot Shewhart charts, drawing OC curves, computes capability indices, and more.
qcc(data, type = c("xbar", "R", "S", "xbar.one", "p", "np", "c", "u", "g"), sizes, center, std.dev, limits, newdata, newsizes, nsigmas = 3, confidence.level, rules = c(1,4), ...) ## S3 method for class 'qcc' print(x, digits = getOption("digits"), ...) ## S3 method for class 'qcc' plot(x, xtime = NULL, add.stats = qcc.options("add.stats"), chart.all = qcc.options("chart.all"), fill = qcc.options("fill"), label.center = "CL", label.limits = c("LCL ", "UCL"), title, xlab, ylab, xlim, ylim, digits = getOption("digits"), ...)
data |
a data frame, a matrix or a vector containing observed data for the variable to chart. Each row of a data frame or a matrix, and each value of a vector, refers to a sample or ”rationale group”. | |||||||||||||||||||||||||||||||
type |
a character string specifying the group statistics to compute.
Furthermore, a user specified type of chart, say | |||||||||||||||||||||||||||||||
sizes |
a value or a vector of values specifying the sample sizes associated with each group. For continuous data provided as data frame or matrix the sample sizes are obtained counting the non- | |||||||||||||||||||||||||||||||
center |
a value specifying the center of group statistics or the ”target” value of the process. | |||||||||||||||||||||||||||||||
std.dev |
a value or an available method specifying the within-group standard deviation(s) of the process. | |||||||||||||||||||||||||||||||
limits |
a two-values vector specifying control limits. | |||||||||||||||||||||||||||||||
newdata |
a data frame, matrix or vector, as for the | |||||||||||||||||||||||||||||||
newsizes |
a vector as for the | |||||||||||||||||||||||||||||||
nsigmas |
a numeric value specifying the number of sigmas to use for computing control limits. It is ignored when the | |||||||||||||||||||||||||||||||
confidence.level |
a numeric value between 0 and 1 specifying the confidence level of the computed probability limits. | |||||||||||||||||||||||||||||||
rules |
a value or a vector of values specifying the rules to apply to the chart. See | |||||||||||||||||||||||||||||||
xtime |
a vector of date-time values as returned by | |||||||||||||||||||||||||||||||
add.stats |
a logical value indicating whether statistics and other information should be printed at the bottom of the chart. | |||||||||||||||||||||||||||||||
chart.all |
a logical value indicating whether both statistics for | |||||||||||||||||||||||||||||||
fill |
a logical value specifying if the in-control area should be filled with the color specified in | |||||||||||||||||||||||||||||||
label.center |
a character specifying the label for center line. | |||||||||||||||||||||||||||||||
label.limits |
a character vector specifying the labels for control limits. | |||||||||||||||||||||||||||||||
title |
a character string specifying the main title. Set | |||||||||||||||||||||||||||||||
xlab, ylab |
a string giving the label for the x-axis and the y-axis. | |||||||||||||||||||||||||||||||
xlim, ylim |
a numeric vector specifying the limits for the x-axis and the y-axis. | |||||||||||||||||||||||||||||||
digits |
the number of significant digits to use. | |||||||||||||||||||||||||||||||
x |
an object of class | |||||||||||||||||||||||||||||||
... |
additional arguments to be passed to the generic function. |
Returns an object of class 'qcc'
.
Luca Scrucca
Mason, R.L. and Young, J.C. (2002) Multivariate Statistical Process Control with Industrial Applications, SIAM.
Montgomery, D.C. (2013) Introduction to Statistical Quality Control, 7th ed. New York: John Wiley & Sons.
Ryan, T. P. (2011), Statistical Methods for Quality Improvement, 3rd ed. New York: John Wiley & Sons, Inc.
Scrucca, L. (2004). qcc: an R package for quality control charting and statistical process control. R News 4/1, 11-17.
Wetherill, G.B. and Brown, D.W. (1991) Statistical Process Control. New York: Chapman & Hall.
qccRules
, cusum
, ewma
, ocCurves
, processCapability
, qccGroups
## ## Continuous data ## data(pistonrings) diameter <- qccGroups(data = pistonrings, diameter, sample) (q <- qcc(diameter[1:25,], type="xbar")) plot(q) (q <- qcc(diameter[1:25,], type="xbar", newdata=diameter[26:40,])) plot(q) q <- qcc(diameter[1:25,], type="xbar", newdata=diameter[26:40,]) plot(q, chart.all=FALSE) plot(qcc(diameter[1:25,], type="xbar", newdata=diameter[26:40,], nsigmas=2)) plot(qcc(diameter[1:25,], type="xbar", newdata=diameter[26:40,], confidence.level=0.99)) q <- qcc(diameter[1:25,], type="R") q plot(q) plot(qcc(diameter[1:25,], type="R", newdata=diameter[26:40,])) plot(qcc(diameter[1:25,], type="S")) plot(qcc(diameter[1:25,], type="S", newdata=diameter[26:40,])) plot(qcc(diameter[1:25,], type="xbar", newdata=diameter[26:40,], rules = 1:4)) # variable control limits out <- c(9, 10, 30, 35, 45, 64, 65, 74, 75, 85, 99, 100) diameter <- qccGroups(data = pistonrings[-out,], diameter, sample) plot(qcc(diameter[1:25,], type="xbar")) plot(qcc(diameter[1:25,], type="R")) plot(qcc(diameter[1:25,], type="S")) plot(qcc(diameter[1:25,], type="xbar", newdata=diameter[26:40,])) plot(qcc(diameter[1:25,], type="R", newdata=diameter[26:40,])) plot(qcc(diameter[1:25,], type="S", newdata=diameter[26:40,])) ## ## Attribute data ## data(orangejuice) q <- with(orangejuice, qcc(D[trial], sizes=size[trial], type="p")) q plot(q) # remove out-of-control points (see help(orangejuice) for the reasons) outofctrl <- c(15,23) q1 <- with(orangejuice[-outofctrl,], qcc(D[trial], sizes=size[trial], type="p")) plot(q1) q1 <- with(orangejuice[-outofctrl,], qcc(D[trial], sizes=size[trial], type="p", newdata=D[!trial], newsizes=size[!trial])) plot(q1) data(orangejuice2) q2 <- with(orangejuice2, qcc(D[trial], sizes=size[trial], type="p")) plot(q2) q2 <- with(orangejuice2, qcc(D[trial], sizes=size[trial], type="p", newdata=D[!trial], newsizes=size[!trial])) plot(q2) data(circuit) plot(with(circuit, qcc(x[trial], sizes=size[trial], type="c"))) # remove out-of-control points (see help(circuit) for the reasons) outofctrl <- c(15,23) q1 <- with(orangejuice[-outofctrl,], qcc(D[trial], sizes=size[trial], type="p")) plot(q1) q1 <- with(orangejuice[-outofctrl,], qcc(D[trial], sizes=size[trial], type="p", newdata=D[!trial], newsizes=size[!trial])) plot(q1) outofctrl <- c(6,20) q1 <- with(circuit[-outofctrl,], qcc(x[trial], sizes=size[trial], type="c")) plot(q1) q1 <- with(circuit[-outofctrl,], qcc(x[trial], sizes=size[trial], type="c", newdata = x[!trial], newsizes = size[!trial])) plot(q1) q1 <- with(circuit[-outofctrl,], qcc(x[trial], sizes=size[trial], type="u", newdata = x[!trial], newsizes = size[!trial])) plot(q1) data(pcmanufact) q1 <- with(pcmanufact, qcc(x, sizes=size, type="u")) q1 plot(q1) data(dyedcloth) # variable control limits plot(with(dyedcloth, qcc(x, sizes=size, type="u"))) # standardized control chart q <- with(dyedcloth, qcc(x, sizes=size, type="u")) z <- (q$statistics - q$center)/sqrt(q$center/q$size) plot(qcc(z, sizes = 1, type = "u", center = 0, std.dev = 1, limits = c(-3,3)), title = "Standardized u chart") ## ## Continuous one-at-time data ## data(viscosity) q <- with(viscosity, qcc(viscosity[trial], type = "xbar.one")) q plot(q) # batch 4 is out-of-control because of a process temperature controller # failure; remove it and recompute viscosity <- viscosity[-4,] plot(with(viscosity, qcc(viscosity[trial], type = "xbar.one", newdata = viscosity[!trial])))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.