CONTRAST Subcommand (UNIANOVA command)

CONTRAST specifies the type of contrast desired among the levels of a factor. For a factor with k levels or values, the contrast type determines the meaning of its k−1 degrees of freedom.

  • Specify the factor name in parentheses following the subcommand CONTRAST.
  • You can specify only one factor per CONTRAST subcommand, but you can enter multiple CONTRAST subcommands.
  • After closing the parentheses, enter an equals sign followed by one of the contrast keywords.
  • This subcommand creates an L matrix such that the columns corresponding to the factor match the contrast given. The other columns are adjusted so that the L matrix is estimable.

The following contrast types are available:

DEVIATION. Deviations from the grand mean. This is the default for factors. Each level of the factor except one is compared to the grand mean. One category (by default, the last) must be omitted so that the effects will be independent of one another. To omit a category other than the last, specify the number of the omitted category (which is not necessarily the same as its value) in parentheses after the keyword DEVIATION. For example:

UNIANOVA Y BY B    
  /CONTRAST(B)=DEVIATION(1).

Suppose factor B has three levels, with values 2, 4, and 6. The specified contrast omits the first category, in which B has the value 2. Deviation contrasts are not orthogonal.

POLYNOMIAL. Polynomial contrasts. This is the default for within-subjects factors. The first degree of freedom contains the linear effect across the levels of the factor, the second contains the quadratic effect, and so on. In a balanced design, polynomial contrasts are orthogonal. By default, the levels are assumed to be equally spaced; you can specify unequal spacing by entering a metric consisting of one integer for each level of the factor in parentheses after the keyword POLYNOMIAL. (All metrics specified cannot be equal; thus, (1, 1, . . . 1) is not valid.) For example:

UNIANOVA RESPONSE BY STIMULUS    
  /CONTRAST(STIMULUS) = POLYNOMIAL(1,2,4)

Suppose that factor STIMULUS has three levels. The specified contrast 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 levels 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, in each instance, the difference between the second and third numbers is twice the difference between the first and second.

DIFFERENCE. Difference or reverse Helmert contrasts. Each level of the factor except the first is compared to the mean of the previous levels. In a balanced design, difference contrasts are orthogonal.

HELMERT. Helmert contrasts. Each level of the factor except the last is compared to the mean of subsequent levels. In a balanced design, Helmert contrasts are orthogonal.

SIMPLE. Each level of the factor except the last is compared to the last level. To use a category other than the last as the omitted reference category, specify its number (which is not necessarily the same as its value) in parentheses following the keyword SIMPLE. For example:

UNIANOVA Y BY B    
  /CONTRAST(B)=SIMPLE(1).

Suppose that factor B has three levels with values 2, 4, and 6. The specified contrast compares the other levels to the first level of B, in which B has the value 2. Simple contrasts are not orthogonal.

REPEATED. Comparison of adjacent levels. Each level of the factor except the first is compared to the previous level. Repeated contrasts are not orthogonal.

SPECIAL. A user-defined contrast. Values specified after this keyword are stored in a matrix in column major order.

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. DIFFERENCE, HELMERT, and POLYNOMIAL contrasts always meet these criteria in balanced designs.

Example

UNIANOVA DEP BY FAC
  /CONTRAST(FAC)=DIFFERENCE
  /DESIGN.
  • Suppose that the factor FAC has five categories and therefore four degrees of freedom.
  • CONTRAST requests DIFFERENCE contrasts, which compare each level (except the first) with the mean of the previous levels.