Chapter Contents |
Previous |
Next |

The GENMOD Procedure |

Each term in a model is called an effect.
Effects are specified in the MODEL statement
in the same way as in the GLM procedure.
You specify effects with a special notation
that uses variable names and operators.
There are two types of variables, *classification* (or
*class*) variables and *continuous* variables.
There are two primary types of operators,
*crossing* and *nesting*.
A third type, the *bar* operator,
is used to simplify effect specification.
Crossing is the type of operator most
commonly used in generalized linear models.

Variables that identify classification
levels are called *class* variables
in the SAS System and are identified in a CLASS statement.
These may also be called *categorical,
qualitative, discrete,* or *nominal* variables.
Class variables can be either character
or numeric.
The values of class variables are called *levels*.
For example, the class variable Sex
could have levels `male' and `female'.

In a model, an explanatory variable that is not declared in a CLASS statement is assumed to be continuous. Continuous variables must be numeric. For example, the heights and weights of subjects in an experiment are continuous variables.

The types of effects most useful in generalized linear models are shown in the following list. Assume that A, B, and C are class variables and that X1 and X2 are continuous variables.

- Regressor effects are specified by writing continuous variables by themselves: X1, X2.
- Polynomial effects are specified by joining two or more continuous variables with asterisks: X1*X2.
- Main effects are specified by writing class variables by themselves: A, B, C.
- Crossed effects (interactions) are specified by joining two or more class variables with asterisks: A*B, B* C, A*B*C.
- Nested effects are specified by following a main effect or crossed effect with a class variable or list of class variables enclosed in parentheses: B(A), C(B A), A*B(C). In the preceding example, B(A) is "B nested within A."
- Combinations of continuous and class variables can be specified in the same way using the crossing and nesting operators.

The bar operator consists of two effects joined with a vertical bar (|). It is shorthand notation for including the left-hand side, the right-hand side, and the cross between them as effects in the model. For example, A | B is equivalent to A B A*B. The effects in the bar operator can be class variables, continuous variables, or combinations of effects defined using operators. Multiple bars are permitted. For example, A | B | C means A B C A*B A*C B*C A*B*C.

You can specify the maximum number of variables in any effect that results from bar evaluation by specifying the maximum number, preceded by an @ sign. For example, A | B | C@2 results in effects that involve two or fewer variables: A B C A*B A*C B*C.

For further information on types of effects and their specification, see Chapter 30, "The GLM Procedure."

Chapter Contents |
Previous |
Next |
Top |

Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.