Previous Page | Next Page

The LOGISTIC Procedure

CLASS Statement
CLASS variable <(options)><variable <(options)>></ options> ;

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 options for each variable by enclosing them in parentheses after the variable name. You can also specify global options for the CLASS statement by placing the options after a slash (/). Global options are applied to all the variables specified in the CLASS statement. If you specify more than one CLASS statement, the global options specified in any one CLASS statement apply to all CLASS statements. However, individual CLASS variable options override the global options. The following options are available:

CPREFIX=n

specifies that, at most, the first n characters of a CLASS variable name be used in creating names for the corresponding design variables. The default is , where is the formatted length of the CLASS variable.

DESCENDING
DESC

reverses the sorting order of the classification variable. If both the DESCENDING and ORDER= options are specified, PROC LOGISTIC orders the categories according to the ORDER= option and then reverses that order.

LPREFIX=n

specifies that, at most, the first n characters of a CLASS variable label be used in creating labels for the corresponding design variables. The default is , where is the formatted length of the CLASS variable.

MISSING

treats missing values (’.’, ‘.A’,...,‘.Z’ for numeric variables and blanks for character variables) as valid values for the CLASS variable.

ORDER=DATA | FORMATTED | FREQ | INTERNAL

specifies the sorting order for the levels of classification variables. By default, ORDER=FORMATTED. For ORDER=FORMATTED and ORDER=INTERNAL, the sort order is machine dependent. When ORDER=FORMATTED is in effect for numeric variables for which you have supplied no explicit format, the levels are ordered by their internal values. This ordering 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 statement.

The following table shows how PROC LOGISTIC 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

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. You can use one of the following keywords; the default is PARAM=EFFECT coding.

EFFECT

specifies effect coding.

GLM

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

ORDINAL

specifies the cumulative parameterization for an ordinal CLASS variable.

POLYNOMIAL | POLY

specifies polynomial coding.

REFERENCE | REF

specifies reference cell coding.

ORTHEFFECT

orthogonalizes PARAM=EFFECT coding.

ORTHORDINAL

orthogonalizes PARAM=ORDINAL coding.

ORTHPOLY

orthogonalizes PARAM=POLYNOMIAL coding.

ORTHREF

orthogonalizes PARAM=REFERENCE coding.

All parameterizations are full rank, except for the GLM parameterization. The REF= option in the CLASS statement determines the reference level for EFFECT and REFERENCE coding, and for their orthogonal parameterizations.

If PARAM=ORTHPOLY or PARAM=POLY, and the classification variable is 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.

Parameter names for a CLASS predictor variable are constructed by concatenating the CLASS variable name with the CLASS levels. However, for the POLYNOMIAL and orthogonal parameterizations, parameter names are formed by concatenating the CLASS variable name and keywords that reflect the parameterization. See the section CLASS Variable Parameterization for further details.

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. Specify the formatted value of the variable if a format is assigned. 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

determines class levels by using no more than the first 16 characters of the formatted values of CLASS, response, and strata variables. When formatted values are longer than 16 characters, you can use this option to revert to the levels as determined in releases previous to SAS 9.0. The TRUNCATE option is available only as a global option. This option invokes the same option in the PROC LOGISTIC statement.

Previous Page | Next Page | Top of Page