Resources

Varying Width Box-and-Whisker Plots

/****************************************************************/
/*          S A S   S A M P L E   L I B R A R Y                 */
/*                                                              */
/*    NAME: SHWBOX7                                             */
/*   TITLE: Varying Width Box-and-Whisker Plots                 */
/* PRODUCT: QC                                                  */
/*  SYSTEM: ALL                                                 */
/*    KEYS: Shewhart Charts, Box Charts,                        */
/*   PROCS: SHEWHART                                            */
/*    DATA:                                                     */
/*                                                              */
/*     REF: SAS/QC Software:  Usage and Reference, Version 6,   */
/*          First Edition, Volume 1 and Volume 2                */
/*    MISC:                                                     */
/*                                                              */
/****************************************************************/

data Times2;
   label Delay = 'Delay in Minutes';
   informat Day date7. ;
   format   Day date7. ;
   input Day @ ;
   do Flight=1 to 25;
      input Delay @ ;
      output;
   end;
   datalines;
01MAR90   12  4   2   2  15   8   0  11   0   0
          0  12   3   .   2   3   5   0   6  25
          7   4   9   5  10
02MAR90   1   .   3   .   0   1   5   0   .   .
          1   5   7   .   7   2   2  16   2   1
          3   1  31   .   0
03MAR90   6   8   4   2   3   2   7   6  11   3
          2   7   0   1  10   2   5  12   8   6
          2   7   2   4   5
04MAR90  12   6   9   0  15   7   1   1   0   2
          5   6   5  14   7  21   8   1  14   3
         11   0   1  11   7
05MAR90   2   1   0   4   .   6   2   2   1   4
          1  11   .   1   0   .   5   5   .   2
          3   6   6   4   0
06MAR90   8   6   5   2   9   7   4   2   5   1
          2   2   4   2   5   1   3   9   7   8
          1   0   4  26  27
07MAR90   9   6   6   2   7   8   .   .  10   8
          0   2   4   3   .   .   .   7   .   6
          4   0   .   .   .
08MAR90   1   6   6   2   8   8   5   3   5   0
          8   2   4   2   5   1   6   4   5  10
          2   0   4   1   1
;

ods graphics on;
title 'Analysis of Airline Departure Delays';
proc shewhart data=Times2;
   boxchart Delay * Day /
      nohlabel
      boxstyle      = schematic
      odstitle      = title
      boxwidthscale = 1 ;
run;

proc shewhart data=Times2;
   xschart Delay * Day / nochart
                         outtable = Delaytab;
run;

data Delaytab;
   length Boxcolor $ 8 ;
   set Delaytab;
   keep Day Boxcolor;
   if _exlims_ = 'UPPER' or _exlims_ = 'LOWER' then do;
      Boxcolor = 'Outside' ;
   end;
   else do;
      Boxcolor = 'Inside' ;
   end;
run;

data Times2;
   merge Times2 Delaytab;
   by Day;
run;

ods graphics off;
title  'Analysis of Airline Departure Delays' ;
title2 '--- Standard Deviation Out of Control';
proc shewhart data=Times2;
   boxchart Delay * Day /
        nohlabel
        boxstyle      = schematic
        boxfill       = ( Boxcolor )
        boxwidthscale = 1
        odstitle      = title;
run;