home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 9 / 09.iso / e / e002 / 1.ddi / QC.TX_ / QC.TX
Encoding:
Text File  |  1992-09-10  |  1.4 KB  |  64 lines

  1. %B=%(%H,@Link,2)/* the link dataset name */
  2.  
  3. CheckVar qc.gsize 5/* see if qc.gsize is defined, if not set it to 5 */
  4. CheckVar qc.Ksigma 3
  5.  
  6. col(1)=ave(%B,qc.gsize)
  7.     /* the ave() also produce the 
  8.      * following data sets
  9.      */
  10. col(2)=_Range
  11. col(3)=_SD
  12.     /* Datasets begin with a 
  13.      * _ means that they are temperary
  14.      * and will be deleted automatically
  15.      */
  16. sum(col(1))
  17. Xbar = sum.mean
  18. sum(col(2))
  19. Rbar = sum.mean
  20.  
  21. %B=%H
  22.     /* we need to save the worksheet name since
  23.      * the next step brings another window into
  24.      * activation
  25.      */
  26. win -B P.%H XbarR
  27.     /* find the plot window named P.%H and opens
  28.      * it from the XbarR template if not already
  29.      * there.
  30.      */
  31.  
  32. layer -o 2 {
  33.     layer -w %B 1 0 1 0 202;
  34.     /* 
  35.      * 202 is line/symbol graph
  36.      */
  37.      Sigma=Rbar/(QCd2(qc.gsize) * sqrt(qc.gsize));
  38.      y1 = Xbar - (qc.Ksigma+1) * Sigma * 1.2;
  39.      y2 = Xbar + (qc.Ksigma+1) * Sigma * 1.2;
  40. };
  41.  
  42. layer -o 1 {
  43.     /* layer 1 is the bottom layer in this template */
  44.     layer -i203 %B_R;
  45.         /* column graph */
  46.     y1=0;x1=0;x2= 1 + sum.N;
  47.     UCL=QCD4(qc.gsize)*Rbar;
  48.     LCL=QCD3(qc.gsize)*Rbar;
  49.     y2 = 1.5*UCL;
  50.     /* the QCLines macro assume UCL and LCL */
  51.     QCLines Rbar;
  52. };
  53.  
  54. /* we delay drwaing the labels because
  55.  * we want to have the correct position
  56.  * set by layer 1
  57.  */
  58. layer -o 2 {
  59.     UCL=Xbar + qc.Ksigma * Sigma;
  60.     LCL=Xbar - qc.Ksigma * Sigma;
  61.     QCLines Xbar;
  62. };
  63.  
  64.