Examples


Example 33.1. A Two-Way Design

The following program uses the GLMMOD procedure to produce the design matrix for a two-way design. The two classification factors have seven and three levels, respectively, so the design matrix contains 1 + 7 + 3 + 21 = 32 columns in all.

  data Plants;   input Type $ @;   do Block=1 to 3;   input StemLength @;   output;   end;   datalines;   Clarion  32.7 32.3 31.5   Clinton  32.1 29.7 29.1   Knox     35.7 35.9 33.1   O'Neill  36.0 34.2 31.2   Compost  31.8 28.0 29.2   Wabash   38.2 37.8 31.9   Webster  32.5 31.1 29.7   ;   proc glmmod outparm=Parm outdesign=Design;   class Type Block;   model StemLength = TypeBlock;   run;   proc print data=Parm;   run;   proc print data=Design;   run;  
Output 33.1.1: A Two-Way Design
start example
  The GLMMOD Procedure   Class Level Information   Class         Levels    Values   Type               7    Clarion Clinton Compost Knox O'Neill Wabash Webster   Block              3    1 2 3   Number of Observations Read          21   Number of Observations Used          21  
end example
 
  The GLMMOD Procedure   Parameter Definitions   Name of   Column    Associated    CLASS Variable Values   Number      Effect       Type      Block   1     Intercept   2     Type          Clarion   3     Type          Clinton   4     Type          Compost   5     Type          Knox   6     Type          O'Neill   7     Type          Wabash   8     Type          Webster   9     Block                      1   10     Block                      2   11     Block                      3   12     Type*Block    Clarion      1   13     Type*Block    Clarion      2   14     Type*Block    Clarion      3   15     Type*Block    Clinton      1   16     Type*Block    Clinton      2   17     Type*Block    Clinton      3   18     Type*Block    Compost      1   19     Type*Block    Compost      2   20     Type*Block    Compost      3   21     Type*Block    Knox         1   22     Type*Block    Knox         2   23     Type*Block    Knox         3   24     Type*Block    O'Neill      1   25     Type*Block    O'Neill      2   26     Type*Block    O'Neill      3   27     Type*Block    Wabash       1   28     Type*Block    Wabash       2   29     Type*Block    Wabash       3   30     Type*Block    Webster      1   31     Type*Block    Webster      2   32     Type*Block    Webster      3  
  The GLMMOD Procedure   Design Points   Observation   Stem                         Column Number   Number     Length  1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  17   1      32.7   1  1  0  0  0  0  0  0  1  0   0   1   0   0   0   0   0   2      32.3   1  1  0  0  0  0  0  0  0  1   0   0   1   0   0   0   0   3      31.5   1  1  0  0  0  0  0  0  0  0   1   0   0   1   0   0   0   4      32.1   1  0  1  0  0  0  0  0  1  0   0   0   0   0   1   0   0   5      29.7   1  0  1  0  0  0  0  0  0  1   0   0   0   0   0   1   0   6      29.1   1  0  1  0  0  0  0  0  0  0   1   0   0   0   0   0   1   7      35.7   1  0  0  0  1  0  0  0  1  0   0   0   0   0   0   0   0   8      35.9   1  0  0  0  1  0  0  0  0  1   0   0   0   0   0   0   0   9      33.1   1  0  0  0  1  0  0  0  0  0   1   0   0   0   0   0   0   10      36.0   1  0  0  0  0  1  0  0  1  0   0   0   0   0   0   0   0   11      34.2   1  0  0  0  0  1  0  0  0  1   0   0   0   0   0   0   0   12      31.2   1  0  0  0  0  1  0  0  0  0   1   0   0   0   0   0   0   13      31.8   1  0  0  1  0  0  0  0  1  0   0   0   0   0   0   0   0   14      28.0   1  0  0  1  0  0  0  0  0  1   0   0   0   0   0   0   0   15      29.2   1  0  0  1  0  0  0  0  0  0   1   0   0   0   0   0   0   16      38.2   1  0  0  0  0  0  1  0  1  0   0   0   0   0   0   0   0   17      37.8   1  0  0  0  0  0  1  0  0  1   0   0   0   0   0   0   0   18      31.9   1  0  0  0  0  0  1  0  0  0   1   0   0   0   0   0   0   19      32.5   1  0  0  0  0  0  0  1  1  0   0   0   0   0   0   0   0   20      31.1   1  0  0  0  0  0  0  1  0  1   0   0   0   0   0   0   0   21      29.7   1  0  0  0  0  0  0  1  0  0   1   0   0   0   0   0   0  
  Design Points   Observation                        Column Number   Number     18  19  20  21  22  23  24  25  26  27  28  29  30  31  32   1     0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   2     0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   3     0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   4     0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   5     0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   6     0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   7     0   0   0   1   0   0   0   0   0   0   0   0   0   0   0   8     0   0   0   0   1   0   0   0   0   0   0   0   0   0   0   9     0   0   0   0   0   1   0   0   0   0   0   0   0   0   0   10     0   0   0   0   0   0   1   0   0   0   0   0   0   0   0   11     0   0   0   0   0   0   0   1   0   0   0   0   0   0   0   12     0   0   0   0   0   0   0   0   1   0   0   0   0   0   0   13     1   0   0   0   0   0   0   0   0   0   0   0   0   0   0   14     0   1   0   0   0   0   0   0   0   0   0   0   0   0   0   15     0   0   1   0   0   0   0   0   0   0   0   0   0   0   0   16     0   0   0   0   0   0   0   0   0   1   0   0   0   0   0   17     0   0   0   0   0   0   0   0   0   0   1   0   0   0   0   18     0   0   0   0   0   0   0   0   0   0   0   1   0   0   0   19     0   0   0   0   0   0   0   0   0   0   0   0   1   0   0   20     0   0   0   0   0   0   0   0   0   0   0   0   0   1   0   21     0   0   0   0   0   0   0   0   0   0   0   0   0   0   1  
Output 33.1.2: The OUTPARM= Data Set
start example
  Obs   _COLNUM_    EFFNAME       Type       Block   1        1       Intercept   2        2       Type          Clarion   3        3       Type          Clinton   4        4       Type          Compost   5        5       Type          Knox   6        6       Type          O'Neill   7        7       Type          Wabash   8        8       Type          Webster   9        9       Block                      1   10       10       Block                      2   11       11       Block                      3   12       12       Type*Block    Clarion      1   13       13       Type*Block    Clarion      2   14       14       Type*Block    Clarion      3   15       15       Type*Block    Clinton      1   16       16       Type*Block    Clinton      2   17       17       Type*Block    Clinton      3   18       18       Type*Block    Compost      1   19       19       Type*Block    Compost      2   20       20       Type*Block    Compost      3   21       21       Type*Block    Knox         1   22       22       Type*Block    Knox         2   23       23       Type*Block    Knox         3   24       24       Type*Block    O'Neill      1   25       25       Type*Block    O'Neill      2   26       26       Type*Block    O'Neill      3   27       27       Type*Block    Wabash       1   28       28       Type*Block    Wabash       2   29       29       Type*Block    Wabash       3   30       30       Type*Block    Webster      1   31       31       Type*Block    Webster      2   32       32       Type*Block    Webster      3  
end example
 
Output 33.1.3: The OUTDESIGN= Data Set
start example
  S   t   e   m   L   e                   C C C C C C C C C C C C C C C C C C C C C C C   n C C C C C C C C C o o o o o o o o o o o o o o o o o o o o o o o   O   g o o o o o o o o o l l l l l l l l l l l l l l l l l l l l l l l   b   t l l l l l l l l l 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 3   s   h 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2   1 32.7 1 1 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0   2 32.3 1 1 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0   3 31.5 1 1 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0   4 32.1 1 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0   5 29.7 1 0 1 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0   6 29.1 1 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0   7 35.7 1 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0   8 35.9 1 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0   9 33.1 1 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0   10 36.0 1 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0   11 34.2 1 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0   12 31.2 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0   13 31.8 1 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0   14 28.0 1 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0   15 29.2 1 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0   16 38.2 1 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0   17 37.8 1 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0   18 31.9 1 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0   19 32.5 1 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0   20 31.1 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0   21 29.7 1 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1  
end example
 

Example 33.2. Factorial Screening

Screening experiments are undertaken to select from among the many possible factors that might affect a response the few that actually do, either simply (main effects) or in conjunction with other factors (interactions). One method of selecting significant factors is forward model selection, in which the model is built by successively adding the most statistically significant effects. Forward selection is an option in the REG procedure, but the REG procedure does not allow you to specify interactions directly (as the GLM procedure does, for example). You can use the GLMMOD procedure to create the screening model for a design and then use the REG procedure on the results to perform the screening.

The following statements create the SAS data set Screening , which contains the results of a screening experiment:

  title 'PROC GLMMOD and PROC REG for Forward Selection Screening';   data Screening;   input a b c d e y;   datalines;     1   1   1   1  1   6.688     1   1   1  1   1   10.664     1   1  1   1   1   1.459     1   1  1  1  1   2.042     1  1   1   1   1   8.561     1  1   1  1  1   7.095     1  1  1   1  1   0.553     1  1  1  1   1   2.352   1   1   1   1   1   4.802   1   1   1  1  1   5.705   1   1  1   1  1  14.639   1   1  1  1   1   2.151   1  1   1   1  1   5.884   1  1   1  1   1   3.317   1  1  1   1   1   4.048   1  1  1  1  1  15.248   ;   run;  

The data set contains a single dependent variable ( y )and five independent factors ( a , b , c , d , and e ). The design is a half-fraction of the full 2 5 factorial, the precise half-fraction having been chosen to provide uncorrelated estimates of all main effects and two-factor interactions.

The following statements use the GLMMOD procedure to create a design matrix data set containing all the main effects and two factor interactions for the preceding screening design.

  ods output DesignPoints = DesignMatrix;   proc glmmod data=Screening;   model y = abcde@2;   run;  

Notice that the preceding statements use ODS to create the design matrix data set, instead of the OUTDESIGN= option in the PROC GLMMOD statement. The results are equivalent, but the columns of the data set produced by ODS have names that are directly related to the names of their corresponding effects.

Finally, the following statements use the REG procedure to perform forward model selection for the screening design. Two MODEL statements are used, one without the selection options (which produces the regression analysis for the full model) and one with the selection options.

  proc reg data=DesignMatrix;   model y = a--d_e;   model y = a--d_e / selection = forward   details   = summary   slentry   = 0.05;   run;  
Output 33.2.1: PROC REG Full Model Fit
start example
  PROC GLMMOD and PROC REG for Forward Selection Screening   The REG Procedure   Model: MODEL1   Dependent Variable: y   Analysis of Variance   Sum of           Mean   Source                   DF        Squares         Square    F Value    Pr > F   Model                    15      861.48436       57.43229        .       .   Error                     0              0              .   Corrected Total          15      861.48436   Root MSE                    .    R-Square     1.0000   Dependent Mean        0.33325    Adj R-Sq          .   Coeff Var                   .   Parameter Estimates   Parameter      Standard   Variable    Label       DF      Estimate         Error   t Value   Pr > t   Intercept   Intercept    1       0.33325             .       .        .   a                        1       4.61125             .       .        .   b                        1       0.21775             .       .        .   a_b         a*b          1       0.30350             .       .        .   c                        1       4.02550             .       .        .   a_c         a*c          1       0.05150             .       .        .   b_c         b*c          1   0.20225             .       .        .   d                        1   0.11850             .       .        .   a_d         a*d          1       0.12075             .       .        .   b_d         b*d          1       0.18850             .       .        .   c_d         c*d          1       0.03200             .       .        .   e                        1       3.45275             .       .        .   a_e         a*e          1       1.97175             .       .        .   b_e         b*e          1   0.35625             .       .        .   c_e         c*e          1       0.30900             .       .        .   d_e         d*e          1       0.30750             .       .        .  
end example
 
Output 33.2.2: PROC REG Screening Results
start example
  PROC GLMMOD and PROC REG for Forward Selection Screening   The REG Procedure   Model: MODEL2   Dependent Variable: y   Summary of Forward Selection   Variable            Number Partial   Model   Step Entered   Label     Vars In R-Square R-Square C(p)    F Value Pr > F   1  a                       1    0.3949   0.3949    .        9.14 0.0091   2  c                       2    0.3010   0.6959    .       12.87 0.0033   3  e                       3    0.2214   0.9173    .       32.13 0.0001   4 a_e        a*e           4    0.0722   0.9895    .       75.66 <.0001  
end example
 

Output 33.2.1 and Output 33.2.2 contain the results of the REG analysis. The full model has 16 parameters (the intercept + 5 main effects + 10 interactions). These are all estimable , but since there are only 16 observations in the design, there are no degrees of freedom left to estimate error; consequently, there is no way to use the full model to test for the statistical significance of effects. However, the forward selection method chooses only four effects for the model: the main effects of factors a , c ,and e , and the interaction between a and e . Using this reduced model enables you to estimate the underlying level of noise, although note that the selection method biases this estimate somewhat.




SAS.STAT 9.1 Users Guide (Vol. 3)
SAS/STAT 9.1, Users Guide, Volume 3 (volume 3 ONLY)
ISBN: B0042UQTBS
EAN: N/A
Year: 2004
Pages: 105

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net