Chapter Contents Previous Next
 XCHART Statement

## Example 12.3: Combined Shewhart -Cusum Scheme

 See CUSCOMB in the SAS/QC Sample Library

Lucas (1982) introduced a combined Shewhart-cusum scheme that is illustrated in this example. Also refer to Ryan (1989). The data set used here is CANS, which is created in "Creating a One-Sided Cusum Chart with a Decision Interval" .

The first step is to compute and save one-sided cusums to detect a positive shift from the mean.

   proc cusum data=cans;
xchart weight*hour /
nochart
mu0    = 8.100          /* target mean              */
sigma0 = 0.050          /* known standard deviation */
delta  = 1              /* shift to be detected     */
h      = 3              /* decision interval        */
k      = 0.5            /* reference value          */
scheme = onesided       /* onesided scheme          */
outtable = tabcus       /* save the result}         */
( drop   = _var_ _subn_ _exlim_
rename = ( _cusum_ = _subr_ _h_ = _uclr_ ) )
;
run;


Note that a headstart value is not used here but can be specified with the HSTART= option. Several variables in the OUTTABLE= data set are dropped or renamed so that they can later be read by the SHEWHART procedure.

The next step is to construct a Shewhart chart (not shown) for individual measurements.

   proc shewhart data=cans;
irchart weight*hour /
nochart
mu0      = 8.100
sigma0   = 0.050
outtable = tabx
( drop   = _subr_  _lclr_ _r_ _uclr_ );
id comment;
run;


By default, limits are computed, but the multiple of can be modified with the SIGMAS= option. As before, the results are saved in an OUTTABLE= data set.

Next, the two OUTTABLE= data sets are merged.

   data combine;
merge tabx tabcus; by hour;
_lclr_ = 0.0;
_r_    = 0.5 * _uclr_;
run;


The data set COMBINE has the structure required for a TABLE= data set used with the IRCHART statement in the SHEWHART procedure (see "TABLE= Data Set" in Chapter 34, "IRCHART Statement").

Finally, the combined scheme is displayed with the SHEWHART procedure.

   title "Combined Shewhart-Cusum Analysis for Weight";
symbol v=dot c=salmon;
proc shewhart table=combine;
irchart weight*hour /
ypct1     = 50
noctl2
ucllabel2 = 'h=0.3'
outlabel  = ( comment )
outlabel2 = ( comment )
cframelab = ligr
cframe    = bigb
split     = '/'
cinfill   = ywh
cconnect  = salmon;
label _subi_ = 'Shewhart/Cusum';
run;


The chart is shown in Output 12.3.1.

Output 12.3.1: Combined Shewhart -Cusum Scheme

Note that a shift is detected by the cusum scheme but not by the Shewhart chart. The point exceeding the decision interval is labeled with the variable COMMENT created in the data set CANS.

Lucas (1982) tabulates average run lengths for combined Shewhart-cusum schemes. The scheme used here has an ARL of 111.1 for and an ARL of 6.322 for .

 Chapter Contents Previous Next Top