\[ \bar{p} = \frac{\sum d_i}{kn} \]
center line
\[ CL = n\bar{p} \]
upper control limit
\[ UCL = n\bar{p} + 3\sqrt{n\bar{p}(1-\bar{p})} \]
lower control limit
\[ LCL = n\bar{p} - 3\sqrt{n\bar{p}(1-\bar{p})} \]
## Package 'qcc' version 2.7
## Type 'citation("qcc")' for citing this R package in publications.
## [1] 0.0357
## [1] 7.14
## [1] 15.01184
## [1] -0.7318434
np_chart <- qcc(defects, type = "np", sizes = n)
np_chart
## List of 11
## $ call : language qcc(data = defects, type = "np", sizes = n)
## $ type : chr "np"
## $ data.name : chr "defects"
## $ data : num [1:50, 1] 8 7 11 3 6 11 4 4 5 8 ...
## ..- attr(*, "dimnames")=List of 2
## $ statistics: Named num [1:50] 8 7 11 3 6 11 4 4 5 8 ...
## ..- attr(*, "names")= chr [1:50] "1" "2" "3" "4" ...
## $ sizes : num [1:50] 200 200 200 200 200 200 200 200 200 200 ...
## $ center : num 7.14
## $ std.dev : num 2.62
## $ nsigmas : num 3
## $ limits : num [1, 1:2] 0 15
## ..- attr(*, "dimnames")=List of 2
## $ violations:List of 2
## - attr(*, "class")= chr "qcc"
The np control chart shows the number of defective wafers observed in each lot of 200 wafers inspected. The center line represents the average number of defective wafers per lot while the upper and lower control limits represent the expected variation in the process.
All the points are within the control limits and there are no unusual patterns in the data. This suggests that the process was operating within control during the period of observation.
If a point falls outside the limits it can indicate that something is affecting the process.
library(qcc)
defects <- c(8, 7, 11, 3, 6, 11, 4, 4, 5, 8,
8, 6, 7, 6, 10, 7, 9, 5, 6, 8,
8, 10, 4, 11, 4, 11, 6, 6, 9, 5,
4, 7, 5, 7, 8, 5, 10, 9, 7, 9,
4, 9, 4, 7, 11, 8, 10, 8, 7, 5)
n <- 200
k <- length(defects)
pbar <- sum(defects) / (k * n)
centerline <- n * pbar
ucl <- centerline + 3 * sqrt(n * pbar * (1 - pbar))
lcl <- centerline - 3 * sqrt(n * pbar * (1 - pbar))
pbar
centerline
ucl
lcl
np_chart <- qcc(defects, type = "np", sizes = n)
np_chart