Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
XCHART Statement

Example 42.3: Plotting OC Curves for Mean Charts

See SHWOC1 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:

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

The following statements compute \beta (the variable BETA) as a function of \nu (the variable NU). The variable NSAMPLE contains the sample size.

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

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

   symbol1 v=none i=join w=2 c=red;
   symbol2 v=none i=join w=2 c=green;
   symbol3 v=none i=join w=2 c=yellow;
   symbol4 v=none i=join w=2 c=blue;
   symbol5 v=none i=join w=2 c=white;
   title1 'OC Curves for Shewhart Charts for Means';
   proc gplot data=oc;
      plot prob*t=nsample /
         frame
         legend=legend1
         vaxis=axis1
         haxis=axis2
         autovref
         autohref
         lvref = 2
         lHREF=2
         vzero
         hzero
         cframe = ligr
         cvref  = white;
      axis1 label =(r=0 a=90)
            value =(t=1 ' ')
            order =(0.0 0.2 0.4 0.6 0.8 1.0)
            minor =none
            offset=(0,0);
      axis2 order =(0 1 2 3 4)
            offset=(0,0)
            minor =(n=3);
      legend1 label=('Sample Size n:');
   run;

Output 42.3.1: OC Curves for Different Subgroup Sample Sizes
xex3.gif (7955 bytes)

Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Top
Top

Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.