A Plant Filtration Study

 /****************************************************************/
 /*              S A S   S A M P L E   L I B R A R Y             */
 /*                                                              */
 /*    NAME: ADXEG2                                              */
 /*   TITLE: A Plant Filtration Study                            */
 /* PRODUCT: QC                                                  */
 /*  SYSTEM: ALL                                                 */
 /*    KEYS: Design of Experiments,Fractional Factorial Designs  */
 /*   PROCS:                                                     */
 /*    DATA:                                                     */
 /*     REF: Box, G.E.P., Hunter, W.G., and Hunter, J.S. (1978). */
 /*               Statistics for Experimenters.  New York: John  */
 /*               Wiley & Sons, pp. 424-429.                     */
 /*    MISC: ADX Macros are stored in the AUTOCALL library       */
 /*                                                              */
 /* A Bottleneck at the Filtration Stage of an Industrial Plant  */
 /*                                                              */
 /* A number of similar chemical plants had been successfully    */
 /* operatting for several years in different locations. In the  */
 /* older plants the time to complete a particular filtration    */
 /* cycle was about 40 minutes, but in a newly constructed plant */
 /* filtration took almost twice as long, resulting in  serious  */
 /* delays.  Box, Hunter, and Hunter describe the use of         */
 /* fractional factorial designs to examine the cause of the     */
 /* difficulty.  The management came up with seven treatment     */
 /* factors to be examined,                                      */
 /*                                                              */
 /*    * the source of water supply (WATR), coming from the town */
 /*          reservoir or from a well,                           */
 /*    * the origin of raw material (RMAT), which are either     */
 /*          made on site or shipped in from the older plants,   */
 /*    * the level of temperature (TEMP),                        */
 /*    * the presence of a recycle device (RECY),                */
 /*    * the rate of addition of caustic soda (SODA),            */
 /*    * the type of filter cloth (CLTH), and                    */
 /*    * the length of holdup time (HOLD).                       */
 /*                                                              */
 /****************************************************************/



 /*--------------------------------------------------------------*/
 /*     EXAMPLE 2:  A DESIGN FOR A PLANT FILTRATION PROBLEM.     */
 /*           SOURCE:  BOX, HUNTER, AND HUNTER (1978).           */
 /*--------------------------------------------------------------*/

 /*
 /  For this example, we need only the fractional factorial macros:
 /  if we haven't already included them, we do so now.
 /---------------------------------------------------------------*/
 %adxgen;
 %adxff;
 %adxinit                        /* Initialize ADX environment.  */

 /*
 /  Find out which designs are available for 7 treatment factors.
 /---------------------------------------------------------------*/
 %adxpff((ntmts=7))

 /*
 /  Box, Hunter, and Hunter choose an 8-run design of resolution 3.
 /---------------------------------------------------------------*/
 %adxffd(filt1,7,8)

 /*
 /  Decode the data. NOTE: String values for levels  must be
 /  enclosed by < >.
 /---------------------------------------------------------------*/
 %adxdcode(filt1, t1 watr <res>  <well>
                 /t2 rmat <site> <other>
                 /t3 temp <low>  <high>
                 /t4 hold <low>  <high>
                 /t5 clth <new>  <old>
                 /t6 soda <fast> <slow>
                 /t7 recy <yes>  <no>)

 /*
 /  Normally,  we would want  to  write a report which will print
 /  the runs in the design in a randomized order and provide space
 /  for a researcher to fill in the values of a response: use the
 /  following to do this:
 /                   %adxrprt(filt1,time)
 /  Assuming this has been done,  we  add the data to the design
 /  with the following DATA step: the numbers can be found in Box,
 /  Hunter, and Hunter (1978), p. 426.
 /---------------------------------------------------------------*/
 proc sort; by watr rmat temp;
 data filt1; set filt1;
    input @@ time;
    cards;
 68.7 66.4 78.6 68.4 38.7 81 41.2 77.7
 ;

 /*
 /  Recode and analyze the data.
 /---------------------------------------------------------------*/
 %adxcode(filt1,filt1cod,watr rmat temp hold clth soda recy)
 %adxffa(resp=time,res=3)

 /*
 /  There are several possible interpretations  of the results of
 /  the analysis.  To  reduce  these  ambiguities  a  selected  set
 /  of 8 additional tests can be run, converting the original
 /  resolution 3 design to one of resolution 4.  This is done by
 /  "fold-over", that is,  by  arranging that the new runs have
 /  signs opposite to those in the original design.
 /---------------------------------------------------------------*/
 %adxinit
 %adxffd(filt2,7,8)
 data filt2;
    set filt2;
    array t{7};
    drop i;
    do i=1 to 7;                /* "Fold-over" the factor levels */
       t{i} = -t{i};
       end;
 run;

 /*
 /  Decode, recode, and analyze all the data again.
 /---------------------------------------------------------------*/
 %adxdcode(filt2, t1 watr <res>  <well>
                 /t2 rmat <site> <other>
                 /t3 temp <low>  <high>
                 /t4 hold <low>  <high>
                 /t5 clth <new>  <old>
                 /t6 soda <fast> <slow>
                 /t7 recy <yes>  <no>)
 proc sort;
    by watr rmat temp;
 data filt2; set filt2;
    input @@ time;
    cards;
 65.0 59.0 61.9 67.6 66.7 47.8 86.4 42.6
 ;
 data filt;
   set filt1 filt2;
 run;
 %adxcode(filt,filtcode,watr rmat temp hold clth soda recy)
 %adxffa(resp=time,res=4)


 /*--------------------------------------------------------------*/
 /*                                                              */
 /* This example illustrates how fractional factorial designs may*/
 /* be used sequentially as building blocks to produce a design  */
 /* of suitable resolution to answer questions at issue. The key */
 /* to solving this problem lay in screening a large number of   */
 /* variables to discover effects involving only a few of them.  */
 /* In this case, the source of water supply and the rate of     */
 /* addition of caustic soda are the two most important          */
 /* variables, with not only large main effects but also a large */
 /* interaction.                                                 */
 /*                                                              */
 /*--------------------------------------------------------------*/