11
qcc: An R package for quality control charting and statistical process control by Luca Scrucca
Introduction
The qcc package for the R statistical environment allows to:
• plot Shewhart quality control charts for continuous, attribute and count data;
• plot Cusum and EWMA charts for continuous data; • draw operating characteristic curves;
• perform process capability analyses;
• draw Pareto charts and cause-and-effect diagrams.
I started writing the package to provide the students in the class I teach a tool for learning the basic concepts of statistical quality control, at the introductory level of a book such as Montgomery (2000). Due to the intended final users, a free statistical environment was important and R was a natural candidate.
The initial design, albeit it was written from scratch, reflected the set of functions available in SPlus. Users of this last environment will find some similarities but also differences as well. In particular, during the development I added more tools and re-designed most of the library to meet the requirements I thought were important to satisfy.
Creating a qcc object
A qcc object is the basic building block to start with.
This can be simply created invoking the qcc function, which in its simplest form requires two arguments: a data frame, a matrix or a vector containing the observed data, and a string value specifying the control chart to be computed. Standard Shewhart control charts are available. These are often classified according to the type of quality characteristic that they are supposed to monitor (see Table 1).
Control charts for continuous variables are usually based on several samples with observations collected at different time point. Each sample or “rationale group” must be provided as a row of a data frame or a matrix. The function qcc.groups can be used to easily group a vector of data values based on a sample indicator. Unequal sample sizes are allowed.