Insets Getting Started Examples

/****************************************************************/
/*          S A S   S A M P L E   L I B R A R Y                 */
/*                                                              */
/*    NAME: SHWINGS                                             */
/*   TITLE: Insets Getting Started Examples                     */
/* PRODUCT: QC                                                  */
/*  SYSTEM: ALL                                                 */
/*    KEYS: Shewhart Charts, Insets                             */
/*   PROCS: SHEWHART                                            */
/*    DATA:                                                     */
/*                                                              */
/*     REF: SAS/QC Software:  Usage and Reference, Version 6,   */
/*          First Edition, Volume 1 and Volume 2                */
/*                                                              */
/****************************************************************/

data Wafers;
   input Batch @;
   do i=1 to 5;
      input Diameter @;
      output;
   end;
   drop i;
   datalines;
 1  35.00 34.99 34.99 34.98 35.00
 2  35.01 34.99 34.99 34.98 35.00
 3  34.99 35.00 35.00 35.00 35.00
 4  35.01 35.00 34.99 34.99 35.00
 5  35.00 34.99 34.98 34.99 35.00
 6  34.99 34.99 35.00 35.00 35.00
 7  35.01 34.98 35.00 35.00 34.99
 8  35.00 35.00 34.99 34.98 34.99
 9  34.99 34.98 34.98 35.01 35.00
10  34.99 35.00 35.01 34.99 35.01
11  35.01 35.00 35.00 34.98 34.99
12  34.99 34.99 35.00 34.98 35.01
13  35.01 34.99 34.98 34.99 34.99
14  35.00 35.00 34.99 35.01 34.99
15  34.98 34.99 34.99 34.98 35.00
16  34.99 35.00 35.00 35.01 35.00
17  34.98 34.98 34.99 34.99 34.98
18  35.01 35.02 35.00 34.98 35.00
19  34.99 34.98 35.00 34.99 34.98
20  34.99 35.00 35.00 34.99 34.99
21  35.00 34.99 34.99 34.98 35.00
22  35.00 35.00 35.01 35.00 35.00
23  35.02 35.00 34.98 35.02 35.00
24  35.00 35.00 34.99 35.01 34.98
25  34.99 34.99 34.99 35.00 35.00
;


ods graphics on;
title 'Mean Chart for Diameters';
proc shewhart data=Wafers;
   xchart Diameter*Batch /
      lsl      = 34.97
      usl      = 35.03
      odstitle = title;
   inset lsl usl cp stddev / height = 3;
run;

title 'Mean Chart for Diameters';
proc shewhart data=Wafers;
   xrchart Diameter*Batch /
      lsl      = 34.97
      usl      = 35.03
      odstitle = title;
   inset lsl='LSL' usl='USL' / pos = nw;
   inset2 cp (6.4) stddev (6.4) / pos = nw;
run;

data Location;
   length _LABEL_ $ 10 _VALUE_ $ 12;
   input _LABEL_ _VALUE_ &;
   datalines;
Plant     Santa Clara
Line      1
Shift     2
;

ods graphics off;
title 'Mean Chart for Diameters';
proc shewhart data=Wafers;
   xchart Diameter*Batch /
      lsl = 34.97
      usl = 35.03;
   inset data= Location lsl='LSL' usl='USL' cp (6.4) stddev (6.4) /
      position = rm
      cshadow  = black
      header   = 'Summary Statistics';
run;