# Polynomial

**Orthogonal polynomial contrasts.** The first degree of freedom contains the linear effect across all
categories; the second degree of freedom, the quadratic effect; the
third degree of freedom, the cubic; and so on, for the higher-order
effects.

You can specify the spacing between levels of the treatment
measured by the given categorical variable. Equal spacing, which is
the default if you omit the metric, can be specified as consecutive
integers from 1 to *k*, where *k* is the number of categories. If the variable *drug* has three categories, the subcommand

`/CONTRAST(DRUG)=POLYNOMIAL `

is the same as

`/CONTRAST(DRUG)=POLYNOMIAL(1,2,3) `

Equal spacing is not always necessary, however. For example, suppose
that *drug* represents different
dosages of a drug given to three groups. If the dosage administered
to the second group is twice that given to the first group and the
dosage administered to the third group is three times that given to
the first group, the treatment categories are equally spaced, and
an appropriate metric for this situation consists of consecutive integers:

`/CONTRAST(DRUG)=POLYNOMIAL(1,2,3) `

If, however, the dosage administered to the second group is four times that given to the first group, and the dosage administered to the third group is seven times that given to the first group, an appropriate metric is

`/CONTRAST(DRUG)=POLYNOMIAL(1,4,7) `

In either case, the result of the contrast specification is that
the first degree of freedom for *drug* contains the linear effect of the dosage levels and the second degree
of freedom contains the quadratic effect.

Polynomial contrasts are especially useful in tests of trends and for investigating the nature of response surfaces. You can also use polynomial contrasts to perform nonlinear curve fitting, such as curvilinear regression.