CONTRAST Subcommand (LOGISTIC REGRESSION command)

CONTRAST specifies the type of contrast that is used for categorical independent variables. The interpretation of the regression coefficients for categorical variables depends on the contrasts that are used. The default is INDICATOR. The categorical independent variable is specified in parentheses following CONTRAST. The closing parenthesis is followed by one of the contrast-type keywords.

  • If the categorical variable has n values, there will be n−1 rows in the contrast matrix. Each contrast matrix is treated as a set of independent variables in the analysis.
  • Only one categorical independent variable can be specified per CONTRAST subcommand, but multiple CONTRAST subcommands can be specified.

The following contrast types are available 1, 2.

INDICATOR(refcat)
Indicator variables. This is the default. Contrasts indicate the presence or absence of category membership. By default, refcat is the first category (represented in the contrast matrix as a row of zeros). To omit a category (other than the first category), specify the sequence number of the omitted category (which is not necessarily the same as its value) in parentheses after the keyword INDICATOR.
DEVIATION(refcat)
Deviations from the overall effect. The effect for each category of the independent variable (except one category) is compared to the overall effect. Refcat is the category for which parameter estimates are not displayed (they must be calculated from the others). By default, refcat is the first category. To omit a category (other than the first category), specify the sequence number of the omitted category (which is not necessarily the same as its value) in parentheses after the keyword DEVIATION.
SIMPLE(refcat)
Each category of the independent variable (except the first category) is compared to the first category. To use a category other than the first as the omitted reference category, specify its sequence number (which is not necessarily the same as its value) in parentheses following the keyword SIMPLE.
DIFFERENCE
Difference or reverse Helmert contrasts. The effects for each category of the independent variable (except the first category) are compared to the mean effects of the previous categories.
HELMERT
Helmert contrasts. The effects for each category of the independent variable (except the last category) are compared to the mean effects of subsequent categories.
POLYNOMIAL(metric)
Polynomial contrasts. The first degree of freedom contains the linear effect across the categories of the independent variable, the second degree of freedom contains the quadratic effect, and so on. By default, the categories are assumed to be equally spaced; unequal spacing can be specified by entering a metric consisting of one integer for each category of the independent variable in parentheses after the keyword POLYNOMIAL. For example, CONTRAST(STIMULUS)=POLYNOMIAL(1,2,4) indicates that the three levels of STIMULUS are actually in the proportion 1:2:4. The default metric is always (1,2, ..., k), where k categories are involved. Only the relative differences between the terms of the metric matter: (1,2,4) is the same metric as (2,3,5) or (20,30,50) because the difference between the second and third numbers is twice the difference between the first and second numbers in each instance.
REPEATED
Comparison of adjacent categories. Each category of the independent variable (except the last category) is compared to the next category.
SPECIAL(matrix)
A user-defined contrast. After this keyword, a matrix is entered in parentheses with k−1 rows and k columns (where k is the number of categories of the independent variable). The rows of the contrast matrix contain the special contrasts indicating the desired comparisons between categories. If the special contrasts are linear combinations of each other, LOGISTIC REGRESSION reports the linear dependency and stops processing. If k rows are entered, the first row is discarded and only the last k−1 rows are used as the contrast matrix in the analysis.

Examples

LOGISTIC REGRESSION VARIABLES = PASS WITH GRE, CLASS
 /CATEGORICAL = CLASS
 /CONTRAST(CLASS)=HELMERT.
  • A logistic regression analysis of the dependent variable PASS is performed on the interval independent variable GRE and the categorical independent variable CLASS.
  • PASS is a dichotomous variable representing course pass/fail status and CLASS identifies whether a student is in one of three classrooms. A HELMERT contrast is requested.
LOGISTIC REGRESSION VARIABLES = PASS WITH GRE, CLASS
 /CATEGORICAL = CLASS
 /CONTRAST(CLASS)=SPECIAL(2 -1 -1
                          0  1 -1).
  • In this example, the contrasts are specified with the keyword SPECIAL.
1 Finn, J. D. 1974. A general model for multivariate analysis. New York: Holt, Rinehart and Winston.
2 Kirk, R. E. 1982. Experimental design, 2nd ed. Monterey, California: Brooks/Cole.