Capability of the Improved Process

 /****************************************************************/
 /*          S A S   S A M P L E   L I B R A R Y                 */
 /*                                                              */
 /*    NAME: QCAD3                                               */
 /*   TITLE: Capability of the Improved Process                  */
 /* PRODUCT: QC                                                  */
 /*  SYSTEM: ALL                                                 */
 /*    KEYS: Capability Analysis,                                */
 /*   PROCS: SHEWHART                                            */
 /*    DATA:                                                     */
 /*    MISC: This is the third of 3 examples showing different   */
 /*          phases in the evolution of a process: 1) analysis   */
 /*          of experimental results; 2) comparison of control   */
 /*          charts for the process before and after design      */
 /*          changes; 3) analysis of the capability of the       */
 /*          improved process. See also QCAD2 and QCAD3.         */
 /*                                                              */
 /*          Differences between graphics devices may result in  */
 /*          output that varies from that shown in the documen-  */
 /*          tation.  Check the SAS log if the graphical output  */
 /*          is not created.                                     */
 /*                                                              */
 /****************************************************************/
goptions htitle=1.2 ftext=simplex;

data fiber;
   input strength @@;
   cards;
2.62884778 2.58126191 2.46674165 2.48322241 2.72998634 3.14818997
3.48549039 3.22810087 2.82315105 1.75037663 3.09431448 2.18349479
2.69281388 3.70586045 3.26476670 2.94636605 3.56131657 3.40818999
3.28410729 1.95459607 3.13870192 4.46655984 5.13889249 1.90157740
1.78053195 1.91088564 3.00886714 1.90945100 3.15535681 2.63583880
2.10264743 2.09375285 2.26813138 2.26426108 2.24591502 1.95083933
2.10045027 4.71320259 3.04562384 1.75569855 2.37920933 5.55825613
1.72166753 1.64551441 3.27098903 2.29325393 1.39129411 2.94790411
1.95432764 1.87516969 2.51019618 4.37813309 2.48485598 3.04039064
3.49938653 2.05907686 2.88589669 3.81026094 2.08804908 4.57468586
2.60500966 2.29820549 2.59566475 3.82996049 2.97152518 3.37195619
2.02485913 3.42143026 2.72502047 2.34988808 2.18482582 3.24339159
2.22945684 1.61996274 1.91995907 2.36957962 3.30955147 3.84149879
2.84861410 1.82769530 2.99776098 2.47514738 2.59101253 3.76807402
5.23817692 4.42339337 3.15474152 2.41170317 2.21570164 2.30611753
6.13198993 3.82789462 2.18269177 2.10779077 4.06919081 1.65742706
2.06239095 2.01583183 2.14114283 3.46324934 3.29755955 4.86182465
2.97596206 2.43632022 4.06131128 3.67575175 2.70411251 3.35234632
2.57786364 4.20658586 2.99615013 1.95911258 2.32672738 2.13621897
1.71691834 2.88032355 2.60561034 2.77432809 3.01491528 3.77587591
3.55144692 2.62660323 2.31775804 3.75694029 2.57559442 2.58705048
2.15759373 1.86650815 1.84187255 1.58776960 1.26283941 1.54629944
2.14103351 3.17351803 2.95627183 4.32915628 1.52153461 1.92053817
1.79084123 1.26769399 2.29170820 4.65506230 2.24585214 3.20253741
2.72541169 1.46812949 1.90823350 2.51876158 2.38546033 3.66331195
2.52426446 1.98074551 3.30195849 2.29334963 1.92835483 3.80194619
2.91238336 3.45225502 2.68056677 3.00864739 2.36771158 3.64303444
2.29532820 2.30859269 4.69305178 1.61922064 3.81367166 2.12022990
2.19383286 4.28609900 2.63628754 2.78614713 2.45562946 2.76126900
2.26359311 2.08955028 2.08949332 2.84716186 2.32864751 2.95656262
2.02848098 3.97565600 3.02458602 3.11820227 1.48837894 3.69980647
2.70942116 2.28767931 2.31888503 2.87051484 1.63149247 3.24134147
2.48195982 2.37417700 4.74951822 1.90301937 2.80217982 2.83962374
2.01852431 3.20188649 4.28890839 3.20325231 1.78276240 2.11950866
5.28064922 3.36782349 4.98543612 2.48179978 3.76501457 2.77631297
5.05675083 2.99148171 1.28028922 1.35082666 3.51271849 1.71605499
4.86489708 2.82843782 1.70086927 2.31147530 3.23424293 2.93823580
2.83969363 4.19363558 2.24608128 1.61928447 2.62286464 3.29222178
2.35600729 3.31131408 1.66387343 2.99562777 3.31877917 2.17330985
4.08519142 2.98650862 3.38958606 1.85325158 2.33920157 2.08032559
3.90353670 3.66039984 3.19317800 2.00234913 1.84564381 2.60287553
2.80397149 2.66275386 2.60465383 2.20100273
;

data legend;
  length function color style $8 position $1 text $16;
  xsys='1';
  ysys='1';
  when='a';
  function='label';
  position='c';
  /*------------------------------------------*/
  /* color, size, and font of annotate legend */
  /*------------------------------------------*/
  color='black';
  size=1.5;
  style='simplex';
  /*----------------------------------------------------*/
  /* Note the numeric values in the legend should match */
  /* the values in data set out1                        */
  /*----------------------------------------------------*/
  x=65; y=80; text='N'; output;
  x=81;       text='250'; output;
  x=65; y=70; text='Mean'; output;
  x=81;       text='2.79'; output;
  x=65; y=60; text='Std Dev'; output;
  x=81;       text='0.89'; output;
  x=65; y=50; text='Skewness'; output;
  x=81;       text='0.90'; output;
  function='move'; x=62; y=45; output;
  function='draw'; x=62; y=90; output;
  function='draw'; x=90; y=90; output;
  function='draw'; x=90; y=45; output;
  function='draw'; x=62; y=45; output;
run;

 /*---------------*/
 /* color options */
 /*---------------*/
pattern1 v=s c=yellow;
pattern2 v=m5x45 c=red;
pattern3 v=m5x45 c=red;
 /*-----------------------------------------------------------*/
 /* symbol1 affects the color and width of the histogram bars */
 /* symbol2 is for the lower spec line                        */
 /* symbol3 is for the upper spec line                        */
 /*-----------------------------------------------------------*/
symbol1 v=none c=blue ;
symbol2 v=none c=red  w=2;
symbol3 v=none c=red  r=2 w=2;

proc capability data=fiber noprint anno=legend;
   var strength;
   spec lsl=1.4 usl=6.4;
   /*-----------------------------------------------------------*/
   /* width of axis + ticks, and font of axis values and labels */
   /*-----------------------------------------------------------*/
   axis1   value=( f=simplex h=1)
           label=( f=simplex h=1.1) ;
   axis2   value=( f=simplex h=1)
           label=( f=simplex h=1.1 a=90 r=0);
   legend1 value=( f=simplex h=1)
           label=( f=simplex h=1)
           cframe=gray cborder=black;
   histogram / lognormal(noprint fill color=white)
               midpoints=.4 to 6.8 by .8
               haxis=axis1
               vaxis=axis2
               cframe=gray
               legend=legend1
               ;
   label strength = 'Tensile Strength of Fiber';
   title 'Current Process Capability';
run;
goptions reset=global;