Compute Cpk Based on Fitted Lognormal Curve
/****************************************************************/
/* S A S S A M P L E L I B R A R Y */
/* */
/* NAME: CAPLCPK */
/* TITLE: Compute Cpk Based on Fitted Lognormal Curve */
/* PRODUCT: QC */
/* SYSTEM: ALL */
/* KEYS: Capability Analysis, Capability Indices, */
/* PROCS: CAPABILITY */
/* DATA: */
/* */
/* NOTES: */
/* MISC: */
/* */
/* REF: Rodriguez, R. N. (1992), "Recent Developments in */
/* Process Capability Analysis", Journal of Quality */
/* Technology, Vol. 24, No. 4, pg. 176-187. */
/* */
/****************************************************************/
options ps=60 ls=80;
title1 'Compute Cpk Based on the Fitted Lognormal Curve';
/*-------------------*/
/* */
/* Lognormal Data */
/* */
/*-------------------*/
data lognorm;
input x @@;
cards;
3.62 3.41 3.16 3.20 3.36 3.56
3.69 3.12 3.15 3.25 3.13 3.25
3.40 3.22 3.31 3.27 3.98 3.38
3.71 3.37 3.34 3.29 3.20 3.68
3.52 3.72 3.37 3.27 3.26 3.95
3.36 3.76 3.30 3.40 3.44 3.52
3.28 3.75 3.50 3.26 3.26 3.31
3.57 3.15 3.83 3.54 3.60 3.80
3.62 3.56 3.27 3.22 3.63 3.17
3.31 3.21 3.54 3.43 3.46 3.36
;
/*----------------------------------------------------*/
/* */
/* Display Histogram with Cpk and Parameter Estimates */
/* */
/*----------------------------------------------------*/
pattern1 c=blue v=s;
pattern2 c=red v=s;
pattern3 c=green v=s;
symbol1 c=white;
proc capability data=lognorm noprint;
spec lsl = 3.1 usl = 3.9
clsl = white cusl = white
llsl = 1 lusl = 2
wlsl = 2 wusl = 2;
hist x / lognormal(indices color=yellow w=2 theta=3.)
cframe = gray
nocurvelegend;
inset lognormal(sigma scale theta (2.) cpk) /
pos = ne
cfill = blue
ctext = white
cframe = white
format = 6.3;
run;
goptions reset=all;