qcc object and
optional within group standard deviation, decision interval sizes, reference
value, rules, and fast initial response value.
cusum(object, newdata)
cusum(object, newdata, type, z.scores, decision.int = 5, se.shift = 1,
target, std.dev, sizes, labels, label.bounds = c("LDB","UDB"),
headstart = decision.int/2, reset = F, add.stats = T,
chart.all = F, ylim.min = NULL, check.cl = F,
highlight = list(pch=1, col=2))
"qcc" which provides information on the type of group
summary statistics to compute and the within group standard deviation necessary
for computing the z-scores.
statistics,
new.statistics, or both in
object are charted.
"xbar",
"s",
"R",
"p",
"np",
"u", or
"c" built-in functions will be used. (See
help(stats.xbar) for more information on these functions.) If the name
of a function, it is used to compute the group summary statistics.
type is
not one of
"xbar",
"s",
"R",
"p",
"np",
"u", or
"c" or if there
does not exist a function with name produced by
paste("zs.", type, sep = "").
center component of
object.
std.dev component of
object.
newdata. This may be used in conjunction with providing summary statistics
rather than the original new data to
newdata 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.
"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.
c("LDB","UDB").
reset = TRUE. The default is
decision.interval/2.
FALSE.
TRUE. Set
add.stats = FALSE if you want to
add your own text or lines to the chart.
statistics component
of
object should be charted along with the cusums of the
new.statistics
component of
object if present and the cusums of the summary statistics of
newdata if given. The default of
FALSE does not chart the
statistics
component of
object.
FALSE. See DETAILS below.
highlight = list(pch = 1, col = 2). This can be a
list of lists of plotting parameters (one list for each of the two kinds of
violations---beyond the decision boundaries and beyond the Shewhart control
limits) for highlighting, successively, each type of violation.
"cusum" object, which inherits from
"shewhart" and
"qcc"
, with all the components of
object plus the following additional
components if they dont already exist in
object:
newdata with "names" attribute
equal to labels. If
new.statistics exists in
object prior to calling
cusum
and
newdata is given, the group summary statistics computed from
newdata
will be appended to the
new.statistics component of
object
and the entire set of statistics returned.
new.sizes exists in
object
prior to calling
cusum and
newdata is given, the group sample sizes
computed from
newdata will be appended to the
new.sizes component of
object
and the entire set of sizes returned.
target argument if specified.
newdata.
If this exists in
object prior to calling
cusum and
newdata is given,
an
"and" and the name of the input data will be appended to the
newdata.name
component of
object and the entire character string returned.
"names" attribute equal to
labels
.
"names" attribute equal to
labels
.
cusum can pass the return value of a call to
cusum,
which includes
newdata, in place of
object with additional data in the
newdata
argument.
The argument
object provides the chart
type or, more specifically, the
type
of group summary statistics (see
help(qcc) for more details) and an
estimate of the within group standard deviation if
std.dev is not given.
Based upon the summary statistics and the within group standard deviation,
taken to be the process standard deviation, cumulative sums are computed
and a chart produced for both upper and lower cumulative sums following a
decision interval scheme discussed by Ryan (1989) and Wetherill and Brown
(1991). The horizontal zero line on the chart divides the upper sums from
the lower sums. The upper sums indicate a shift in the process above the
target value and the lower sums indicate a shift in the process below the
target value.
The argument
decision.int sets the width of the decision interval in
standard errors of the summary statistics. The argument
se.shift
is used to specify the size of the shift you want to detect. Because
Shewhart charts are primarily useful for detecting large shifts (2-3
standard errors) in the process' center, cusum charts are usually used in
conjunction with Shewhart charts with settings appropriate for detecting
0.5 to 1.5 standard error shifts.
se.shift specifies shifts in standard
errors of the group summary statistics. By default
se.shift = 1, for
detecting a 1 standard error shift, and is equal to twice the reference value,
k.
Usually when an out-of-control signal is generated by a large (or small)
cumulative sum, a search is conducted and a cause is assigned and removed
if possible to correct the process. In this case, the cumulative sums are
reset and monitoring continues. By resetting the sums to something other than
zero (called a headstart), a fast initial response (FIR) cusum is produced.
This is useful for quickly detecting a process that hasn't been fully corrected.
When
reset = TRUE the cusums will be reset to
headstart each time a
cumulative sum exceeds one of the decision boundaries.
One additional improvement to cusum charts results from checking for a large
deviation from the target value of a single group summary statistic.
A group summary statistic greater than 3 standard errors from the target
is equivalent to that summary statistic being outside 3-sigma Shewhart
control limits. When
check.cl = TRUE, summary statistics violating Shewhart
control limits are flagged as well as large cumulative sums. If
object is
of class
"shewhart", it will have a
cntrl.limits component which will be
used to check for violating summary statistics. Otherwise, 3-sigma Shewhart
control limits, centered about
target, will be computed to check for
violating summary statistics.
The
ylim.min argument can be used to expand the range of the y-axis if
additional
detail needs to be added to the chart. For example, additional limits can be
added to a chart by setting
ylim.min appropriately. If the additional limits
are in
addl.limits, then setting
ylim.min = addl.limits will guarantee that
the y-axis range is large enough for any subsequent calls to
abline or
lines
. When low level plotting functions like
abline are used to add
detail to a cusum chart, you need to specify
add.stats = FALSE in the call to
cusum
or else the coordinates will be incorrect for adding detail.
std.dev argument, or the
std.dev
component of
object in that order of preference.
If
newdata is given, the cusums of the summary statistics for
newdata
along with the cusums of any summary statistics contained in the
new.statistics
component of
object are charted. If
newdata is missing,
the cusums of the
new.statistics component of
object
is charted. If
chart.all = TRUE the cusums of the
statistics
component of
object is included on the chart. Repeated calls to
cusum with
the return value of the previous call as
object and a
newdata argument each
time charts the summary statistics of the aggregate of the
newdata arguments.
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.
cusum(qcc(matrix(rnorm(100), ncol = 5), type = "xbar"))