An example may help to illustrate the construction of control limits for counts data. We are inspecting 25 successive wafers, each containing 100 chips. Here the wafer is the inspection unit. The observed number of defects turn into chart. http://www.itl.nist.gov/div898/handbook/pmc/section3/pmc331.htm.
library(qcc)
## Package 'qcc' version 2.7
## Type 'citation("qcc")' for citing this R package in publications.
# Water content of antifreeze data (Wetherill and Brown, 1991, p. 120)
x <- c(2.23, 2.53, 2.62, 2.63, 2.58, 2.44, 2.49, 2.34, 2.95, 2.54, 2.60, 2.45,
2.17, 2.58, 2.57, 2.44, 2.38, 2.23, 2.23, 2.54, 2.66, 2.84, 2.81, 2.39,
2.56, 2.70, 3.00, 2.81, 2.77, 2.89, 2.54, 2.98, 2.35, 2.53)
# the Shewhart control chart for one-at-time data
# 1) using MR (default)
qcc(x, type="xbar.one", data.name="Water content (in ppm) of batches of antifreeze")
## List of 11
## $ call : language qcc(data = x, type = "xbar.one", data.name = "Water content (in ppm) of batches of antifreeze")
## $ type : chr "xbar.one"
## $ data.name : chr "Water content (in ppm) of batches of antifreeze"
## $ data : num [1:34, 1] 2.23 2.53 2.62 2.63 2.58 2.44 2.49 2.34 2.95 2.54 ...
## ..- attr(*, "dimnames")=List of 2
## $ statistics: Named num [1:34] 2.23 2.53 2.62 2.63 2.58 2.44 2.49 2.34 2.95 2.54 ...
## ..- attr(*, "names")= chr [1:34] "1" "2" "3" "4" ...
## $ sizes : int [1:34] 1 1 1 1 1 1 1 1 1 1 ...
## $ center : num 2.57
## $ std.dev : num 0.179
## $ nsigmas : num 3
## $ limits : num [1, 1:2] 2.03 3.11
## ..- attr(*, "dimnames")=List of 2
## $ violations:List of 2
## - attr(*, "class")= chr "qcc"
Control charts involving counts can be either for the total number of nonconformities (defects) for the sample of inspected units, or for the average number of defects per inspection unit.
df = read.csv("D:/R_Files/wafer_defects.csv")
qcc(df$Defects, type="xbar.one", data.name="Number of Wafer Defects")
## List of 11
## $ call : language qcc(data = df$Defects, type = "xbar.one", data.name = "Number of Wafer Defects")
## $ type : chr "xbar.one"
## $ data.name : chr "Number of Wafer Defects"
## $ data : int [1:25, 1] 16 14 28 16 12 20 10 12 10 17 ...
## ..- attr(*, "dimnames")=List of 2
## $ statistics: Named int [1:25] 16 14 28 16 12 20 10 12 10 17 ...
## ..- attr(*, "names")= chr [1:25] "1" "2" "3" "4" ...
## $ sizes : int [1:25] 1 1 1 1 1 1 1 1 1 1 ...
## $ center : num 16
## $ std.dev : num 5.28
## $ nsigmas : num 3
## $ limits : num [1, 1:2] 0.153 31.847
## ..- attr(*, "dimnames")=List of 2
## $ violations:List of 2
## - attr(*, "class")= chr "qcc"