CUSUM Procedure
Creates a two-sided, V-mask Cumulative Sum chart of a process mean.
Usage
CUSUM, data, TargetMean=N
Input Parameters
data—A one or two dimensional array of process data. A 1D-array may be either sample means or individual observations. A 2D-array must be of the form MxN, where M is the number of samples and N is the number of observations in each sample. Each sample must contain the same number of observations. For example, if you take four measurements from each of 16 production runs you must arrange the data into a 16x4 array.
Required Keywords
TargetMean—(required) The process mean against which you are testing.
Keywords
H—The decision interval. This is the unit half-height of the V-mask's vertical component. For example, an H value of 2 results in a vertical component of the V-mask that is 4 units long.
Stdh—The decision interval expressed in multiples of the sample standard deviation.
K—The slope of the arms of the V-mask.
Stdk—The slope of the arms of the V-mask in multiples of the sample standard deviation.
Alpha—The probability of incorrectly concluding that a shift has occurred (a false alarm). This is used to calculate an H value. This method requires that you also supply either a 'Delta' or a 'Shift' value as well.
AxisColor—A color index for the chart axes. (Defaults to !P.COLOR)
Background—A color index for the chart's background. (Default is color index 0.)
Color—A color index or array of color indices for the plot line and plot symbols.
Compress—A toggle to set the plot YRange based on the data values instead of the V-mask parameters. This ensures that all data points appear in the plot area, but may result in a portion of the V-mask moving off of the plot area. (Default is to base the YRange on the V-mask position.)
Data—A Toggle to scale the Y Axis using the data values. This causes the H and K values to be scaled as well.
Delta—The magnitude of the shift that you wish to detect, expressed in multiples of the sample standard deviation.
Info—A toggle to have the procedure print out the final values of H, K, Sigma and, if present, Delta that were used to construct the chart.
NoClip—A toggle to turn off clipping of the data points on the chart.
PSym—The plotting symbol to use for the data points. (Default is -25, boxes containing an X at the data point, connected by lines.)
RefLinePoints—A point or array of points on the Y Axis at which to plot horizontal reference lines.
RefLineColor—A color index or array of color indices for the horizontal reference lines. (Default is !P.COLOR)
RefLineStyle—A linestyle value or array of linestyle values for the horizontal reference lines. (Default is a solid line.)
RefLineThick—An individual or array of floating-point values for the thickness of the horizontal reference lines. (Default is 1.0.)
Shift—The magnitude of the shift you wish to detect, expressed in data units.
TargetMean—(required) The target process mean against which you are testing.
Title—The title of the plot.
VMaskColor—The color of the V-mask lines. (Default is !P.COLOR)
VMaskLength—The length along the X Axis of the arms of the V-mask, expressed in number of samples. (Default is 10.)
VMaskLineStyle—The linestyle of the V-mask. (Default is a solid line.)
VMaskThick—The thickness of the V-mask line. (Default is 1.0.)
XTitle—The label for the X Axis.
YTitle—The label for the Y Axis.
SampleN—The number of observations in each sample. This value is only used when you supply a 1D array of input data and indicates that the array contains sample means calculated from 'SampleN' observations each. (Default is 1, indicating that each value is an individual observation. For 2D arrays, the value is taken from the array dimensions.)
 
note
The V-mask is built using the H and K parameters(below). The H value is specified either through the 'H=' keyword, the 'Stdh=' keyword, or calculated with the 'Alpha=' keyword, with precedence in that order. You must provide one of these values.
The K value is given via either the 'K=' keyword, the 'Stdk=k' keyword or calculated from values passed in via the 'Delta=' or 'Shift=' keywords, with precedence in that order. You must provide one of these values.
Discussion
A CUSUM chart plots the cumulative deviations of sample values from a target value. A V-mask is overlaid representing upper and lower control limits. Points that fall outside of these limits indicate an out-of-control process. The cumulative nature of the plot allows it to indicate small process shifts faster than many other types of control charts.
Example
; 3 observations each, from 6 samples
run1 = [15.09, 15.17, 14.99]
run2 = [14.87, 15.46, 15.01]
run3 = [15.00, 15.13, 14.68]
run4 = [14.94, 15.15, 14.69]
run5 = [14.65, 15.02, 15.12]
run6 = [15.01, 15.08, 15.13]
 
; Create a samples by observations (6x3) array
run = TRANSPOSE([[run1],[run2],[run3],[run4],[run5],[run6]])
 
; From previous calculations, we have established a target
; mean of 14.95, decision interval(H) of 0.8 and a target
; shift of 0.15. This chart shows an in-control process.
CUSUM, run, TargetMean=14.95, H=.8, Shift=.15
See Also