XCHART Statement: SHEWHART Procedure

Example 18.36 Plotting OC Curves for Mean Charts

Note: See Plotting OC Curves for Mean Charts in the SAS/QC Sample Library.

This example uses the GPLOT procedure and the DATA step function PROBNORM to plot operating characteristic (OC) curves for $\bar{X}$ charts with 3$\sigma $ limits. An OC curve is plotted for each of the subgroup samples sizes 1, 2, 3, 4, and 16. Refer to page 226 in Montgomery (1996). Each curve plots the probability $\beta $ of not detecting a shift of magnitude $\nu \sigma $ in the process mean as a function of $\nu $. The value of $\beta $ is computed using the following formula:

\begin{eqnarray*} \beta & = & P\{ LCL \leq \bar{X_{i}} \leq UCL \} \\ & = & \Phi (3 - \nu \sqrt {n}) - \Phi (-3 - \nu \sqrt {n}) \end{eqnarray*}

The following statements compute $\beta $ (the variable prob) as a function of $\nu $ (the variable t). The variable nSample contains the sample size.

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;

The following statements use the GPLOT procedure to display the OC curves shown in Output 18.36.1:

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

Output 18.36.1: OC Curves for Different Subgroup Sample Sizes

OC Curves for Different Subgroup Sample Sizes