CONTRAST Keyword (CSGLM command)
The contrast types that may be specified on the CONTRAST
keyword are described below.
The CSGLM
procedure sorts levels of the factor in ascending order and defines
the highest level as the last level. (If the factor is a string variable,
the value of the highest level is locale-dependent.)
SIMPLE (value). Each level of the factor (except the highest level)
is compared to the highest level. SIMPLE
is the default contrast type if the COMPARE
keyword is specified.
- The
SIMPLE
keyword may be followed optionally by parentheses containing a value. Put the value inside a pair of quotation marks if the value is formatted (such as date or currency) or if the factor is of string type. If a value is specified, the factor level with that value is used as the omitted reference category. If the specified value does not exist in the data, a warning is issued and the highest level is used. - For example:
CSGLM y BY a … /EMMEANS TABLES=a COMPARE=a CONTRAST=SIMPLE(1).
The specified contrast compares all levels of factor A (except level 1) to level 1. Simple contrasts are not orthogonal.
DEVIATION (value). Each level of the factor (except the highest level) is compared to the grand mean.
The DEVIATION
keyword may
be followed optionally by parentheses containing a value. Put the
value inside a pair of quotation marks if the value is formatted (such
as date or currency) or if the factor is of string type. If a value
is specified, the factor level with that value is used as the omitted
reference category. If the specified value does not exist in the
data, a warning is issued and the highest level is used. For example:
CSGLM y BY a … /EMMEANS TABLES=a
COMPARE=a CONTRAST=DEVIATION(1).
The specified contrast
omits level 1 of A. Deviation contrasts are not orthogonal.
DIFFERENCE. Each level of the factor (except the lowest level) is compared to the mean of previous levels. In a balanced design, difference contrasts are orthogonal.
HELMERT. Each level of the factor (except the highest level) is compared to the mean of subsequent levels. In a balanced design, Helmert contrasts are orthogonal.
REPEATED. Each level of the factor (except the highest level) is compared to the previous level. Repeated contrasts are not orthogonal.
POLYNOMIAL (number list). Polynomial contrasts. The first degree of freedom contains the linear effect across the levels of the factor, the second contains the quadratic effect, and so on. By default, the levels are assumed to be equally spaced; the default metric is (1 2 . . . k), where k levels are involved.
- The
POLYNOMIAL
keyword may be followed optionally by parentheses containing a number list. Numbers in the list must be separated by spaces or commas. Unequal spacing may be specified by entering a metric consisting of one integer for each level of the factor. Only the relative differences between the terms of the metric matter. Thus, for example, (1 2 4) is the same metric as (2 3 5) or (20 30 50) because, in each instance, the difference between the second and third numbers is twice the difference between the first and second numbers. All numbers in the metric must be unique; thus, (1 1 2) is not valid. - For example:
CSGLM y BY a … /EMMEANS TABLES=a COMPARE=a CONTRAST=POLYNOMIAL(1 2 4).
Suppose that factor A has three levels. The specified contrast indicates that the three levels of A are actually in the proportion 1:2:4. In a balanced design, polynomial contrasts are orthogonal.
Orthogonal contrasts are particularly useful. In a balanced design, contrasts are orthogonal if the sum of the coefficients in each contrast row is 0 and if, for any pair of contrast rows, the products of corresponding coefficients sum to 0.