Resources

Box Chart With Variable Width Boxes

 /****************************************************************/
 /*          S A S   S A M P L E   L I B R A R Y                 */
 /*                                                              */
 /*    NAME: SHWBXSCL                                            */
 /*   TITLE: Box Chart With Variable Width Boxes                 */
 /* PRODUCT: QC                                                  */
 /*  SYSTEM: ALL                                                 */
 /*    KEYS: Shewhart Charts, Box Charts,                        */
 /*   PROCS: SHEWHART                                            */
 /*    DATA:                                                     */
 /*                                                              */
 /*     REF: SAS/QC Software:  Examples                          */
 /*    MISC: If you are using a monochrome graphics device,      */
 /*          eliminate the CBOXFILL and CFRAME options.          */
 /*                                                              */
 /****************************************************************/
 options ps=60 ls=80 nodate;

 /* generate data with varying sample sizes */
data a;
   drop j;
   do i=1 to 10;
      do j=1 to 10;
         x=rannor(15531); output;
      end;
   end;
   do i=11 to 20;
      do j=1 to 50;
         x=rannor(15531); output;
      end;
   end;
run;

title1 'Width Proportional to Sample Size';
proc shewhart data=a;
   boxchart x * i /
      boxwidthscale = 1.0
      cboxfill      = red
      cbox          = white
      cframe        = gray
      novangle
      serifs ;
run;

title1 'Width Proportional to sqrt(n)';
proc shewhart data=a;
   boxchart x * i /
      boxwidthscale = 0.5
      cboxfill      = blue
      cbox          = white
      cframe        = gray
      novangle
      serifs ;
run;

title1 'Width Proportional to log(n)';
proc shewhart data=a;
   boxchart x * i /
      boxwidthscale = 0.0
      cboxfill      = green
      cbox          = white
      cframe        = gray
      novangle
      serifs ;
run;


goptions reset=all;