Computing Nonstandard Capability Indices

/****************************************************************/
/*          S A S   S A M P L E   L I B R A R Y                 */
/*                                                              */
/*    NAME: CPCPMK                                              */
/*   TITLE: Computing Nonstandard Capability Indices            */
/* PRODUCT: QC                                                  */
/*  SYSTEM: ALL                                                 */
/*    KEYS: Capability Analysis, Capability Indices,            */
/*   PROCS: CAPABILITY                                          */
/*    DATA:                                                     */
/*                                                              */
/* SUPPORT: saswgr                                              */
/*     REF: SAS/QC Software:  Usage and Reference, Version 6,   */
/*          First Edition, Volume 1 and Volume 2                */
/*    MISC:                                                     */
/*                                                              */
/*                                                              */
/*  Examples in the documentation were created using the        */
/*    statement:  ods listing style=statistical;                */
/*                                                              */
/****************************************************************/

data Titanium;
   label Hardness = 'Hardness Measurement';
   input Hardness @@;
   datalines;
1.38  1.49  1.43  1.60  1.59
1.34  1.44  1.64  1.83  1.57
1.45  1.74  1.61  1.39  1.63
1.73  1.61  1.35  1.51  1.47
1.46  1.41  1.56  1.40  1.58
1.43  1.53  1.53  1.58  1.62
1.58  1.46  1.26  1.57  1.41
1.53  1.36  1.63  1.36  1.66
1.49  1.55  1.67  1.41  1.39
1.75  1.37  1.36  1.86  1.49
;

proc capability data=Titanium noprint;
   var Hardness;
   specs lsl=0.8 target=1.6 usl=2.4;
   output out=Indices
      n       = n
      mean    = avg
      std     = std
      var     = var
      lsl     = lsl
      target  = t
      usl     = usl
      pnormal = pnormal
      cpm     = cpm ;
run;

data Indices;
   set Indices;
   d    = 0.5*( USL - LSL );
   m    = 0.5*( USL + LSL );
   num  = d - abs( avg - m );
   den  = 3 * sqrt( (n-1)*var/n + (avg-t)*(avg-t) );
   cpmk = num/den;
run;

title "Capability Analysis of Titanium Hardness";
proc print data=Indices noobs;
   var n avg std lsl t usl cpm cpmk pnormal;
run;

proc capability data=Titanium specialindices;
   var Hardness;
   specs lsl=0.8 target=1.6 usl=2.4;
run;