Bias of Estimator for Cp

 /****************************************************************/
 /*       S A S   S A M P L E   L I B R A R Y                    */
 /*                                                              */
 /*    NAME: CPBIAS                                              */
 /*   TITLE: Bias of Estimator for Cp                            */
 /* PRODUCT: QC                                                  */
 /*  SYSTEM: ALL                                                 */
 /*    KEYS: Capability Analysis, Capability Indices,            */
 /*   PROCS: G3D                                                 */
 /*    DATA:                                                     */
 /*                                                              */
 /*     REF: W. L. Pearn, S. Kotz, N. L. Johnson (1992).         */
 /*          "Distributional and Inferential Properties of       */
 /*          Process Capability Indices".  Journal of Quality    */
 /*          Technology 24, pp. 216-231.                         */
 /*                                                              */
 /*   NOTES: This program calculates the bias for the estimator  */
 /*          of Cp using results of Pearn et al. (1992)          */
 /*                                                              */
 /*    MISC:                                                     */
 /*                                                              */
 /****************************************************************/

   options ps=60 ls=80;

   data cp;
     keep ds n bi;
     label n  = ' n '
           ds = 'd/Sigma'
           bi = 'Bias'
           ;
     do ds = 2 to 6 by 0.05;
       do n = 30 to 120 by 5;
         f   = n-1;
         tmp = lgamma((f-1)/2) - lgamma(f/2);
         ex  = exp(tmp)*sqrt((f/2));
         ex  = (ds/3)*ex;
         bi  = ex - (ds/3);
         output;
       end;
     end;
   run;

 axis1 order=(30 to 120 by 30);

 title 'Bias of Estimator for Cp';
 proc g3d;
   plot ds*n = bi /
     xticknum = 4
     yticknum = 5
     zticknum = 5
     zmin     =  0.00
     zmax     =  0.06
     rotate   = 45
     tilt     =   70
     grid
     ;
  run;

 goptions reset=all;