A Textile Study

 /****************************************************************/
 /*              S A S   S A M P L E   L I B R A R Y             */
 /*                                                              */
 /*    NAME: ADXEG7                                              */
 /*   TITLE: A Textile Study                                     */
 /* PRODUCT: QC                                                  */
 /*  SYSTEM: ALL                                                 */
 /*    KEYS: Design of Experiments,Factorial Designs             */
 /*   PROCS:                                                     */
 /*    DATA:                                                     */
 /*     REF: Box, G.E.P., and Cox, D.R. "An Analysis of          */
 /*               Transformations".  Journal of the Royal        */
 /*               Statistical Society, B-26, pp. 211-243.        */
 /*    MISC: ADX Macros are stored in the AUTOCALL library       */
 /*                                                              */
 /* A simple 3**3 design was used to study the effects different */
 /* factors on the failure of a yarn manufacturing process. The  */
 /* design factors are                                           */
 /*    * the length of test specimins of yarn, ranging from 250  */
 /*          to 350 mm,                                          */
 /*    * the amplitude of the loading cycle, ranging from 8 to   */
 /*          10 mm,                                              */
 /*    * the load, ranging from 40 to 50 grams.                  */
 /* The measured response was time (in cycles) until failure,    */
 /* but it could as easily have been the inverse of this         */
 /* quantity, the failure rate.  An analysis using %adxtrans     */
 /* reveals a clear optimum power transformation right around    */
 /* the log transform.                                           */
 /*                                                              */
 /****************************************************************/


 /*--------------------------------------------------------------*/
 /*              EXAMPLE 7:  A TEXTILE STUDY                     */
 /*              SOURCE:  BOX AND COX (1964).                    */
 /*--------------------------------------------------------------*/


 /*
 /  For this example, we need only general macros, since we will
 /  use FACTEX itself to create the design: if we haven't already
 / included them, we do so now.
 /---------------------------------------------------------------*/
 %adxgen;
 %adxinit                        /* Initialize ADX environment.  */

 /*
 /  The design itself is a simple 3**3 factorial: we use FACTEX
 /  directly.
 /---------------------------------------------------------------*/
 proc factex;
    factors len amp load / nlev=3;
    output out=yarn len  nvals=(250 300 350)
                    amp  nvals=(  8   9  10)
                    load nvals=( 40  45  50);
 run;

 /*
 /  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 the response: use the
 /  following to do this:
 /                   %adxrprt(yarn,failcyc)
 /  Assuming this has been done,  we  add the data to the design
 /  with the following DATA step.
 /---------------------------------------------------------------*/
 data yarn; set yarn;
    input failcyc @@;
    output;
 cards;
  674  370  292  338  266 210  170 118  90
 1414 1198  634 1022  620 438  442 332 220
 3636 3184 2000 1568 1070 566 1140 884 360
 ;

 /*
 /  We need to recode this data so that we can analyze it.
 /---------------------------------------------------------------*/
 %adxcode(yarn,yarn,len amp load)

 /*
 /  Create the cross-product and squared terms of the second order
 /  model.
 /---------------------------------------------------------------*/
 %adxqmod(yarn,yarn,len amp load,1)

 /*
 /  And do the transformation analysis, relying on the default
 /  model set up by %adxqmod.
 /---------------------------------------------------------------*/
 %adxtrans(yarn,tranyarn,failcyc)

 /*--------------------------------------------------------------*/
 /*                                                              */
 /* The estimated power transformation is lambda = -0.2, but the */
 /* 95 % confidence interval contains lambda = 0, which          */
 /* corresponds to the log transform.  The analysis indicates    */
 /* that the transformation really *is* required: not only does  */
 /* the residual mean square dip sharply in the neighborhood of  */
 /* the optimum, but whereas almost *all 10* of the parameters   */
 /* of the model are significant when the original responses are */
 /* analyzed, only the four of them are with respect to the      */
 /* transformed data, the intercept and the three linear effects */
 /* of the factors.  In this case, working with the data in the  */
 /* original metric clouds the issue and impedes scientific      */
 /* understanding of the underlying process.                     */
 /*                                                              */
 /*--------------------------------------------------------------*/


 /*
 /  If you have SAS/GRAPH licensed, try the following code to
 /  produce a high-resolution plot of the T-values for the
 /  parameters versus lambda.
 /    symbol1  i=spline; symbol2 i=spline; symbol3 i=spline;
 /    symbol4  i=spline; symbol5 i=spline; symbol6 i=spline;
 /    symbol7  i=spline; symbol8 i=spline; symbol9 i=spline;
 /    symbol10 i=spline;
 /    proc gplot data=adxreg;
 /       plot (intercept &adxfit)*adxlam / overlay;
 /    run;
 /---------------------------------------------------------------*/