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.
allows missing value (’.’ for a numeric variable and blank for a character variable) as a valid value for the CLASS variable.
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.
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:
specifies effect coding.
specifies less-than-full-rank, reference-cell coding; this option can be used only as a global option.
specifies the cumulative parameterization for an ordinal CLASS variable.
specifies polynomial coding.
specifies reference-cell coding.
orthogonalizes PARAM=EFFECT.
orthogonalizes PARAM=ORDINAL.
orthogonalizes PARAM=POLYNOMIAL.
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.
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.
designates the first ordered level as reference.
designates the last ordered level as reference.
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.
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.