Resources

Two-Way Comparative Histogram

/****************************************************************/
/*          S A S   S A M P L E   L I B R A R Y                 */
/*                                                              */
/*    NAME: CAPCMH3                                             */
/*   TITLE: Two-Way Comparative Histogram                       */
/* PRODUCT: QC                                                  */
/*  SYSTEM: ALL                                                 */
/*    KEYS: Capability Analysis, Two-Way Comparative Histogram, */
/*   PROCS: CAPABILITY                                          */
/*    DATA:                                                     */
/*                                                              */
/* SUPPORT: saswgr                                              */
/*     REF: SAS/QC Software:  Usage and Reference, Version 6,   */
/*          First Edition, Volume 1 and Volume 2                */
/*    MISC:                                                     */
/*                                                              */
/****************************************************************/

* Define a format for time periods;
proc format ;
   value mytime
      1 = '1992'
      2 = '1993'
      3 = 'Target for 1994'
   ;
* Simulate the data;
data Disk;
   keep Supplier Year Width;
   length Supplier $ 16;
   label  Width = 'Opening Width (inches)';
   format Year mytime. ;
   Year = 1;
   Supplier = 'Supplier A';
   avg      = 1.895 ;
   std      = 0.0027 ;
   do i = 1 to 260;
      Width = avg + std * rannor(15535); output;
   end;
   Supplier = 'Supplier B';
   avg      = 1.8983 ;
   std      = 0.0024 ;
   do i = 1 to 260;
      Width = avg + std * rannor(15535); output;
   end;
   Year = 2;
   Supplier = 'Supplier A';
   avg      = 1.8970 ;
   std      = 0.0013 ;
   do i = 1 to 260;
      Width = avg + std * rannor(15535); output;
   end;
   Supplier = 'Supplier B';
   avg      = 1.8980 ;
   std      = 0.0013 ;
   do i = 1 to 260;
      Width = avg + std * rannor(15535); output;
   end;
run;

title "Results of Supplier Training Program";
proc capability data=Disk noprint;
   specs  lsl = 1.8925
          usl = 1.9027;
   comphist Width / class      = ( Supplier Year )
                    classkey   = ('Supplier A' '1993')
                    intertile  = 1.0
                    vaxis      = 0 10 20 30
                    ncols      = 2
                    nrows      = 2
                    odstitle   = title;
   inset cpk (4.2) / noframe pos = n;
run;