Resources

Plotting OC Curves for Mean Charts

/****************************************************************/
/*          S A S   S A M P L E   L I B R A R Y                 */
/*                                                              */
/*    NAME: SHWOC1                                              */
/*   TITLE: Plotting OC Curves for Mean Charts                  */
/* PRODUCT: QC                                                  */
/*  SYSTEM: ALL                                                 */
/*    KEYS: Shewhart Charts, Mean Charts, OC Curves,            */
/*   PROCS: GPLOT                                               */
/*    DATA:                                                     */
/*                                                              */
/*     REF: SAS/QC Software:  Usage and Reference, Version 6,   */
/*          First Edition, Volume 1 and Volume 2                */
/*                                                              */
/****************************************************************/

data oc;
   keep prob nSample t plot2;
   plot2=.;
   do nSample=1, 2, 3, 4, 16;
      do j=0 to 400;
         t=j/100;
         prob=probnorm( 3-t*sqrt(nSample)) -
              probnorm(-3-t*sqrt(nSample));
         output;
      end;
   end;
   label t   ='Shift in Population Mean (Unit=Std Dev)'
        prob='Probability of Not Detecting Shift';
run;

proc sgplot data=oc;
   series x=t y=prob /
      group=nSample lineattrs=(pattern=solid thickness=2);
   yaxis grid;
   label nSample='Sample Size';
run;