Resources

A Chemical Reaction Study

 /****************************************************************/
 /*              S A S   S A M P L E   L I B R A R Y             */
 /*                                                              */
 /*    NAME: ADXEG1                                              */
 /*   TITLE: A Chemical Reaction 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. 375-380.                     */
 /*    MISC: ADX Macros are stored in the AUTOCALL library       */
 /*                                                              */
 /* A fractional factorial design was used to study a chemical   */
 /* reaction to find out what percentage of the chemicals        */
 /* responded in the reactor. The researchers identified five    */
 /* treatment factors which were thought to influence the        */
 /* percentage of reaction,                                      */
 /*                                                              */
 /*    * the feed rate of the chemicals (FEED), which range from */
 /*          10 to 15 liters/min,                                */
 /*    * the percentage of a catalyst (CAT) that is added,       */
 /*          ranging from 1% to 2%,                              */
 /*    * the agitation rate of the reactor (AGIT), ranging from  */
 /*          100 to 120 rpm,                                     */
 /*    * the temperature (TEMP), ranging from 140 to 180 degrees */
 /*          C, and                                              */
 /*    * the concentration (CON), ranging from 3% to 6%.         */
 /*                                                              */
 /****************************************************************/


 /*--------------------------------------------------------------*/
 /*     EXAMPLE 1:  A DESIGN FOR A CHEMICAL REACTION STUDY.      */
 /*           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.  */

 /*
 /  First,  find out which designs are available for the five
 /  treatment factors.
 /---------------------------------------------------------------*/
 %adxpff((ntmts=5))

 /*
 /  Box, Hunter, and Hunter choose a half-fractional factorial
 /  design of resolution 5, which has 16 runs and no blocking.
 /---------------------------------------------------------------*/
 %adxffd(reactor,5,16)

 /*
 /  We now have a data set that contains 5 treatment variables and
 /  16 observations.  We want to decode the data into factors and
 /  levels which the experimenter will understand.  NOTE: The
 /  factors must  be separated by a slash when typing in this
 /  statement.
 /---------------------------------------------------------------*/
 %adxdcode(reactor,t1 feed 10 15 /t2 cat 1 2 /t3 agit 100 120
          /t4 temp 140 180 /t5 con 3 6)

 /*
 /  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(reactor,response)
 /  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. 379.
 /---------------------------------------------------------------*/
 data reactor;
    set reactor;
    input @@ response;
    cards;
 56 69 53 49 63 78 67 95 53 45 55 60 65 93 61 82
 ;
 run;

 /*
 /  We need to recode this data so that we can analyze it.
 /---------------------------------------------------------------*/
 %adxcode(reactor,reactor,feed cat agit temp con)

 /*
 /  Now analyze the coded data.
 /---------------------------------------------------------------*/
 %adxffa(resp=response,res=5)



 /*--------------------------------------------------------------*/
 /*                                                              */
 /* The output contains  the results of the analysis of variance */
 /* as well as a normal plot of the estimated effects.  A normal */
 /* plot is a scatterplot of the quantiles of univariate data    */
 /* against the expected quantiles of a random normal sample.    */
 /* Under the null hypothesis that all effects are zero, the     */
 /* estimates should behave like a random sample from such a     */
 /* distribution, and should fall pretty much along the          */
 /* reference line which is also plotted. The reference line     */
 /* corresponds to the normal distribution with zero mean and    */
 /* standard deviation given by                                  */
 /*                                                              */
 /*    - the estimated standard error of the effects estimates,  */
 /*          if an estimate of error is available; or            */
 /*    - the standard deviation of all the effects, if no        */
 /*          estimate of error is available.                     */
 /*                                                              */
 /* Typically most of the effects will indeed be zero and their  */
 /* estimates will fall on this line:  a few will be significant */
 /* and will not line up with the rest.  In this example, the    */
 /* analysis of variance indicates that the largest effects are  */
 /* due to catalyst, temperature, concentration, and their       */
 /* interactions, and the normal plot confirms this. The results */
 /* produced by the fractional factorial design are not very     */
 /* different from those obtained from a complete factorial      */
 /* design---but, of course, it was obtained with only half the  */
 /* effort!                                                      */
 /*                                                              */
 /*--------------------------------------------------------------*/