Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
PCHART Statement

Example 38.5: OC Curve for Chart

See SHWPOC in the SAS/QC Sample Library

This example uses the GPLOT procedure and the OUTLIMITS= data set FAILLIM2 from the previous example to plot an OC curve for the p chart shown in Output 38.4.3.

The OC curve displays \beta(the probability that pi lies within the control limits) as a function of p (the true proportion nonconforming). The computations are exact, assuming that the process is in control and that the number of nonconforming items (Xi) has a binomial distribution.

The value of \beta is computed as follows:

\beta & = & P(p_{i} \leq {UCL}) - P(p_{i} \lt {LCL}) \ & = & P(X_{i} \leq n {UCL...
 ...p} (n{LCL}, n + 1 - n{LCL})+ P(X_{i} = n{UCL}) -
 I_{p} (n{UCL}, n + 1 - n{UCL})
Here, Ip(·, ·) denotes the incomplete beta function. The following DATA step computes \beta (the variable BETA) as a function of p (the variable P):

   data ocpchart;
      set faillim2;
      keep beta fraction;
      nucl=_limitn_*_uclp_;
      nlcl=_limitn_*_lclp_;
      do p=0 to 500;
         fraction=p/1000;
         if nucl=floor(nucl) then
            adjust=probbnml(fraction,_limitn_,nucl) -
                   probbnml(fraction,_limitn_,nucl-1);
         else adjust=0;
         if nlcl=0 then
            beta=1 - probbeta(fraction,nucl,_limitn_-nucl+1) + adjust;
         else beta=probbeta(fraction,nlcl,_limitn_-nlcl+1) -
                   probbeta(fraction,nucl,_limitn_-nucl+1) +
                   adjust;
         if beta >= 0.001 then output;
         end;
      call symput('lcl', put(_lclp_,5.3));
      call symput('mean',put(_p_,   5.3));
      call symput('ucl', put(_uclp_,5.3));
   run;

The following statements display the OC curve shown in Output 38.5.1:

   title "OC Curve for p Chart With LCL=&LCL, p0=&MEAN, and UCL=&UCL";
   symbol i=j w=2 v=none c=yellow;
   proc gplot data=ocpchart;
      plot beta*fraction /
         vaxis=axis1
         haxis=axis2
         frame
         autovref
         autohref
         lvref = 2
         lHREF=2
         vzero
         hzero
         cframe = ligr
         cHREF=cxfefefe
         cvref  = cxfefefe;
      label fraction = 'Fraction Nonconforming'
            beta     = 'Beta';
   run;

Output 38.5.1: OC Curve for p Chart
pex5.gif (5519 bytes)

Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Top
Top

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