|Details of the OPTEX Procedure
Specifying Effects in MODEL Statements
This section discusses how to specify the linear model that you plan to
fit with the design. The OPTEX procedure provides for the same general
linear models as the GLM procedure, although it does not use the GLM
procedure's over-parameterized technique for generating the design matrix
(see "Static Coding" .)
Each term in a model, called an effect, is a variable or
combination of variables. To specify effects, you use a special
notation involving variables and operators. There are two kinds of
variables: classification variables and continuous
variables. Classification variables separate observations
into groups, and the model depends on them through these groups;
on the other hand, the model depends on the actual (or coded)
values of continuous variables. There are two primary
operators: crossing and nesting. A third operator,
the bar operator, simplifies the specification for multiple
crossed terms, as in a factorial model. The
used in combination with the bar operator, further simplifies
specification of crossed terms.
When specifying a model, you must list the classification
variables in a CLASS statement. Any variables in the model that
are not listed in the CLASS statement are assumed to be continuous.
Continuous variables must be numeric.
Five types of effects can be specified in the MODEL statement. Each row of
the design matrix is generated by combining values for the independent
variables according to effects specified in the MODEL statement.
This section discusses how to specify different types of effects and
explains how they relate to the columns of the design matrix.
In the following, assume that A, B, and C are classification variables
and X1, X2, and X3 are continuous variables.
You can shorten the specification of a factorial model using the bar
operator. For example, the following statements show two ways of
specifying a full three-way factorial model:
- Regressor Effects
Regressor effects are specified by writing continuous variables by
X1 X2 X3
For regressor effects, the actual values of the variable are used in
the design matrix.
- Polynomial Effects
Polynomial effects are specified by joining two or more continuous
variables with asterisks.
X1*X1 X1*X1*X1 X1*X2 X1*X2*X3 X1*X1*X2
Polynomial effects are also referred to as interactions or cross
products of continuous variables; when a variable is joined with
itself, polynomial effects are referred to as quadratic effects,
cubic effects, and so on. In the preceding examples, the first two
effects are the quadratic and cubic effects for X1, respectively.
The remaining effects are cross products.
For polynomial effects, the value used in the
design matrix is the product of the values of the constituent
- Main Effects
If a classification variable A has k levels, then its main effect
has k-1 degrees of freedom, corresponding to k-1 independent differences
between the mean response at different
levels. Main effects are specified by writing class variables by
A B C
Most designs involve main effects since these correspond
to the factors in your experiment. For example, in a factorial design
for a chemical process, the main effects may be temperature, pressure,
and the level of a catalyst.
For information on how the OPTEX procedure generates the k-1 columns
in the design matrix corresponding to the main effect of a classification
variable, see "Design Coding" .
- Crossed Effects
Crossed effects (or interactions) are specified by joining class
variables with asterisks.
A*B B*C A*B*C
The number of degrees of freedom for a crossed effect is the product
of the numbers of degrees of freedom for the constituent main effects.
The columns in the design matrix corresponding to a crossed effect
are formed by the horizontal direct products of the constituent main
- Continuous-by-Class Effects
- Continuous-by-class effects are specified by joining continuous
variables and class variables with asterisks.
The design columns for a continuous-by-class effect are constructed
by multiplying the values in the design columns for the continuous
variables and the class variable.
Note that all design matrices start with a column of ones for
the assumed intercept term unless you use the NOINT option in the MODEL
model a b c a*b a*c b*c a*b*c;
When the vertical bar (
|) is used, the right- and left-hand sides become
effects, and their cross becomes an effect. Multiple bars are
permitted. The expressions are expanded from left to right using
rules given by Searle (1971). For example,
A|B|C is evaluated
The bar operator does not cross a variable with itself. To
produce a quadratic term, you must specify it directly.
You can also specify the maximum number of variables involved in
any effect that results from bar evaluation by putting it at the end
of a bar effect, preceded by an
@ sign. For example, the specification
A|B|C@2 results in
only those effects that contain two or fewer variables (in this
case A, B, A*B, C, A*C, and B*C.)
Main Effects Model
For a three-factor main effects model with A, B, and C as the
factors, the MODEL statement is
model a b c;
Factorial Model with Interactions
To specify interactions in a factorial model, join effects with
asterisks, as described previously. For example, the following statements
show two ways of specifying a complete factorial model, which
includes all the interactions:
model a b c a*b a*c b*c a*b*c;
The following statements show two ways of specifying a model with
crossed and quadratic effects (for a central composite design, for
model x1 x2 x1*x2 x3 x1*x3 x2*x3
x1*x1 x2*x2 x3*x3;
model x1|x2|x3@@2 x1*x1 x2*x2 x3*x3;
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.