Previous Page | Next Page

The GENMOD Procedure

CLASS Statement

The CLASS statement names the classification variables to be used in the analysis. The CLASS statement must precede the MODEL statement. You can specify various v-options for each variable by enclosing them in parentheses after the variable name. You can also specify global v-options for the CLASS statement by placing them after a slash (/). Global v-options are applied to all the variables specified in the CLASS statement. If you specify more than one CLASS statement, the global v-options specified in any one CLASS statement apply to all CLASS statements. However, individual CLASS variable v-options override the global v-options.

DESCENDING
DESC

reverses the sorting order of the classification variable.

MISSING

allows missing value (’.’ for a numeric variable and blank for a character variable) as a valid value for the CLASS variable.

ORDER=DATA
ORDER=FORMATTED
ORDER=FREQ
ORDER=INTERNAL

specifies the sorting order for the levels of classification variables. This order determines which parameters in the model correspond to each level in the data, so the ORDER= option can be useful when you use the CONTRAST or ESTIMATE statement. If ORDER=FORMATTED for numeric variables for which you have supplied no explicit format, the levels are ordered by their internal values. Note that this represents a change from previous releases for how class levels are ordered. Before SAS 8, numeric class levels with no explicit format were ordered by their BEST12. formatted values, and to revert to the previous ordering you can specify this format explicitly for the affected classification variables. The change was implemented because the former default behavior for ORDER=FORMATTED often resulted in levels not being ordered numerically and usually required the user to intervene with an explicit format or ORDER=INTERNAL to get the more natural order. The following table shows how PROC GENMOD interprets values of the ORDER= option.

Value of ORDER=

Levels Sorted by

DATA

order of appearance in the input data set

FORMATTED

external formatted value, except for numeric

 

variables with no explicit format, which are

 

sorted by their unformatted (internal) value

FREQ

descending frequency count; levels with the

 

most observations come first in the order

INTERNAL

unformatted value

By default, ORDER=FORMATTED. For FORMATTED and INTERNAL, the sort order is machine dependent.

For more information about sorting order, see the chapter on the SORT procedure in the Base SAS Procedures Guide and the discussion of BY-group processing in SAS Language Reference: Concepts.

PARAM=keyword

specifies the parameterization method for the classification variable or variables. Design matrix columns are created from CLASS variables according to the following coding schemes. The default is PARAM=GLM. If PARAM=ORTHPOLY or PARAM=POLY, and the CLASS levels are numeric, then the ORDER= option in the CLASS statement is ignored, and the internal, unformatted values are used. See the section CLASS Variable Parameterization for further details. You can use the following keywords:

EFFECT

specifies effect coding.

GLM

specifies less-than-full-rank, reference-cell coding; this option can be used only as a global option.

ORDINAL
THERMOMETER

specifies the cumulative parameterization for an ordinal CLASS variable.

POLYNOMIAL
POLY

specifies polynomial coding.

REFERENCE
REF

specifies reference-cell coding.

ORTHEFFECT

orthogonalizes PARAM=EFFECT.

ORTHORDINAL
ORTHOTHERM

orthogonalizes PARAM=ORDINAL.

ORTHPOLY

orthogonalizes PARAM=POLYNOMIAL.

ORTHREF

orthogonalizes PARAM=REFERENCE.

The EFFECT, POLYNOMIAL, REFERENCE, and ORDINAL suboptions and their orthogonal parameterizations are full rank. The REF= option in the CLASS statement determines the reference level for the EFFECT and REFERENCE suboptions and their orthogonal parameterizations.

REF=’level’ | keyword

specifies the reference level for PARAM=EFFECT, PARAM=REFERENCE, and their orthogonalizations. For an individual (but not a global) variable REF= option, you can specify the level of the variable to use as the reference level. For a global or individual variable REF= option, you can use one of the following keywords. The default is REF=LAST.

FIRST

designates the first ordered level as reference.

LAST

designates the last ordered level as reference.

TRUNCATE<=n>

specifies the length of CLASS variable values to use in determining CLASS variable levels. If you specify TRUNCATE without the length , the first 16 characters of the formatted values are used. When formatted values are longer than 16 characters, you can use this option to revert to the levels as determined in releases before SAS 9. The default is to use the full formatted length of the CLASS variable. The TRUNCATE option is available only as a global option.

Previous Page | Next Page | Top of Page