Mean Square Error of Estimator for Cp

 /****************************************************************/
 /*       S A S   S A M P L E   L I B R A R Y                    */
 /*                                                              */
 /*    NAME: CPMSE                                               */
 /*   TITLE: Mean Square Error 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 MSE for the estimator   */
 /*          of Cp using results of Pearn et al. (1992).         */
 /*                                                              */
 /*    MISC:                                                     */
 /*                                                              */
 /****************************************************************/

   options ps=60 ls=80;

   data cp;
     keep ds n bi mse;
     label n  = ' n '
           ds = 'd/Sigma'
          mse = 'MSE'
           ;
     do ds = 2 to 6 by 0.05;
       do n = 30 to 120 by 5;
         f = n-1;
         ex = (gamma((f-1)/2)/gamma(f/2))*sqrt((f/2));
         ex = (ds/3)*ex;
         bi = ex - (ds/3);
         va = (gamma((f-1)/2)/gamma(f/2))**2;
         va = (f/(f-2))-((f/2)*va);
         va = ((ds/3)**2)*va;
         mse = va + (bi*bi);
         output;
       end;
     end;
   run;

 title1 'Mean Square Error of Estimator of Cp';
 proc g3d;
   plot ds*n = mse
     /
     xticknum = 4
     yticknum = 5
     zticknum = 5
     zmin =  0.00
     zmax =  0.10
     rotate = 45
     tilt =   70
     grid
     ;
 axis1 order=(30 to 120 by 30);
 run;

 goptions reset=all;