Create a Quality Control Chart Object

DESCRIPTION:
Computes group summary statistics and the within group standard deviation in preparation to applying quality control chart functions such as shewhart and cusum.

USAGE:
qcc(data, type, std.dev, sizes, labels=<<see below>>)

REQUIRED ARGUMENTS:
data:
vector, matrix, data frame, or list containing the data for which the "qcc" object is being created. If a vector each element corresponds to a different group center and std.dev is then required. If a matrix or data frame, each row corresponds to a different group. If a list, each component corresponds to a different group.
type:
a character string or function specifying group statistics to compute. If a character string and one of "xbar", "s", "R", "p", "np", "u", or "c", built-in functions will be used to compute the group summary statistics. (See help(stats.xbar) for more details on these functions.) If the name of a function, it is used to compute the group summary statistics and a central value for the group summary statistics and std.dev must also be given. See DETAILS below.

OPTIONAL ARGUMENTS:
std.dev:
a numeric vector or function for specifying the within group standard deviation(s). If of length 1, it will be taken as the within group standard deviation pooled over all the groups. If of length greater than 1, it must have length equal to the number of groups, in which case, it contains the individual within group standard deviations in the same order as the groups in data. If a function, it will be used to compute the within group standard deviation from data. If missing, the default method for type will be used to compute the within group standard deviation. Required if type is given as a function. See DETAILS below.
sizes:
a numeric vector specifying the sample sizes associated with each group. This may be used in conjunction with providing summary statistics rather than the original data to data and is necessary if type is "p", "np" or "u". If of length 1, its value is assumed to be the size of all the groups.
labels:
character vector of labels for each group. The default vector of labels is the "names" attribute for a vector or list, the first component of the "dimnames" attribute for a matrix, the "row.names" attribute of a data frame, or, if the appropriate attribute is NULL, the first n integers where n is the number of groups.

VALUE:
an object of class "qcc" containing the following components:

statistics:
a vector of group summary statistics with "names" attribute equal to labels.
sizes:
a vector of group sample sizes.
center:
the center of statistics computed as specified by type.
std.dev:
an estimate of the overall within group standard deviation.
type:
identical to input type.
data.name:
a character string (vector of length 1) containing the name of the input data passed as data.

DETAILS:
The argument data provides the data for computing statistics, center, and std.dev; or it can contain the actual summary statistics provided std.dev and sizes are also given. Missing values (NA) must be removed from data prior to calling qcc.

The argument type specifies the kind of control chart wanted. If type is a character string then it must be one of those in first column of the table below. The commonly used name for the corresponding chart is given in the second column. type common name ---- --------------------------- "xbar" x Bar s Chart "s" s Chart "R" R or Range Chart "p" p Chart for defectives "np" np Chart for defectives "u" u Chart for nonconformities "c" c Chart for nonconformities

Appropriate default functions are used to compute statistics, center and std.dev for each of the types above. These are specified in the following table. The names of the default functions that do the computation are formed by pasting together either "stats" (for statistics and center) or "sd" (for std.dev), a period, and the value of type. Thus the summary statistics and center of an xbar chart are computed by stats.xbar and the within group standard deviation is computed by sd.xbar. std.dev sample size type statistic is based on can be ------ -------------- --------------- ------------- "xbar" mean var. within equal/unequal "s" std dev within var. within equal/unequal "R" range var. within equal/unequal "p" prop. defective prop. defective equal/unequal "np" num. defective prop. defective equal/unequal "c" nonconformities nonconformities equal (1) "u" nonconformities nonconformities equal/unequal For more information on the built-in functions for computing group summary statistics and the within group standard deviation see the help files for the appropriate functions. For example, to get information on how group summary statistics and the within group standard deviation are computed for the xbar chart, see help(stats.xbar) and help(sd.xbar), respectively.

If type is a function name then it must return a list with two components named statistics and center which correspond to the components of the return value with the same name. In this case, std.dev must also be given.

std.dev may be given as a numeric vector or function. If std.dev is a function, it is assumed to return an estimate of the within group standard deviation suitable for computing the control limits or decision boundaries of the charts produced by shewhart or cusum. If you specify your own function for the std.dev argument you may not give summary statistics as data for the "xbar", "s", or "R" charts.


REFERENCES:
Montgomery, D. C. (1985). Statistical Quality Control. New York: John Wiley & Sons.

Ryan, T. P. (1989). Statistical Methods For Quality Improvement. New York: John Wiley & Sons.

Wetherill, G. B. and Brown, D. W. (1991). Statistical Process Control. New York: Chapman and Hall.


SEE ALSO:
shewhart , shewhart.rules , cusum .

EXAMPLES:
qcc(matrix(rnorm(100), ncol = 5), type = "xbar")