The GEE Procedure

CLASS Statement

  • CLASS variables </ options>;

The CLASS statement names the classification variables to be used in the analysis. If the CLASS statement is used, it must appear before the MODEL statement.

Classification variables can be either character or numeric. CLASS levels are determined from the formatted values of the variables. Thus, you can use formats to group values into levels. For more information, see the discussion of the FORMAT procedure in the Base SAS Procedures Guide and the discussions of the FORMAT statement and SAS formats in SAS Formats and Informats: Reference.

You can specify the following options for classification variables:

DESCENDING
DESC

reverses the sort order of the classification variable. If you specify both the DESCENDING and ORDER= options, PROC GEE orders the categories according to the ORDER= option and then reverses that order.

ORDER=order-type

specifies the sort order for the categories of categorical variables. This ordering determines which parameters in the model correspond to each level in the data. When the default ORDER=FORMATTED is in effect for numeric variables for which you have supplied no explicit format, the levels are ordered by their internal values. Table 2 shows how PROC GEE interprets values of the ORDER= option.

Table 2: Sort Order for Categorical Variables

order-type Levels Sorted By
DATA Order of appearance in the input data set
FORMATTED External formatted value, except for numeric variables that have no explicit format, which are sorted by their unformatted (internal) value
FREQ Descending frequency count; levels that have the most observations come first in the order
INTERNAL Unformatted value


For the FORMATTED and INTERNAL values, the sort order is machine-dependent. If you specify the ORDER= option in the MODEL statement and the ORDER= option in the CLASS statement, the former takes precedence.

For more information about sort order, see the chapter on the SORT procedure in the Base SAS Procedures Guide and the discussion of BY-group processing in SAS Programmers Guide: Essentials.

Last updated: December 09, 2022