Why Plan Polynomial Contrasts?
A repeated-measure profile is a sequence of means, one for each occasion. When the occasions are equally spaced, a planned question might concern whether the means rise or fall linearly, bend into a curve, or show a more complex pattern. Polynomial contrasts turn these questions into specific linear combinations of the occasion means.
The word planned matters: the contrasts are chosen to represent meaningful trend components, not selected only after inspecting which comparisons look largest. For equally spaced occasions with equal weight, the natural polynomial coordinates are orthogonal. This makes it possible to describe separate components of the profile without their coefficient vectors overlapping algebraically.
Constructing the Contrast Vectors
Center the occasion indices by setting \(x_j=j-(k-1)/2\). Centering puts the occasion coordinates around zero, which makes the trend patterns easier to interpret. The first polynomial vector is the constant vector \(q_0=(1,\ldots,1)^\mathsf{T}\); it represents the overall level rather than a contrast. The linear vector begins with \(x=(x_0,\ldots,x_{k-1})^\mathsf{T}\).
For higher degrees, use discrete Gram–Schmidt orthogonalization. Write \(v_r=(x_0^r,\ldots,x_{k-1}^r)^\mathsf{T}\). Starting with \(q_0\), define, for \(r=1,\ldots,k-1\),
This subtracts from \(v_r\) its components along all the earlier polynomial vectors. The resulting \(q_r\) is a degree-\(r\) polynomial pattern across the occasions and is orthogonal to each \(q_s\) for \(s<r\). Since it is orthogonal to \(q_0\), its coefficients sum to zero: it is a contrast.
Proof. Assume \(q_0,\ldots,q_{r-1}\) are nonzero and mutually orthogonal. For any \(s<r\), the defining formula gives
To show \(q_r\) is nonzero, suppose instead that it were zero. The formula would then say that the values of \(x^r\) at all \(k\) occasion coordinates equal the values of a polynomial of degree at most \(r-1\). Their difference is a monic degree-\(r\) polynomial with \(k\ge r+1\) distinct roots, which is impossible. Thus each step is defined and gives a nonzero vector orthogonal to all earlier ones. For \(r\ge1\), orthogonality to \(q_0\) means \(q_0^\mathsf{T}q_r=\sum_j(q_r)_j=0\), so \(q_r\) is a contrast. \(\square\)
Multiplying a contrast vector by any nonzero constant does not change the hypothesis it represents; it only changes the scale of the contrast value. Consequently, integer-scaled versions are often more convenient than the unscaled Gram–Schmidt vectors.
Worked Polynomial Contrasts
Worked Example: Three Occasions and Curvature
For three equally spaced occasions, the centered coordinates are \((-1,0,1)\). The linear vector is \(q_1=(-1,0,1)\). The centered square pattern is \((1,0,1)\), whose average is \(2/3\); subtracting that average gives \((1/3,-2/3,1/3)\). An integer-scaled quadratic contrast is therefore \(q_2=(1,-2,1)\).
Suppose the occasion means are \(10,14,18\). The linear contrast is \(q_1^\mathsf{T}\mu=-10+18=8\), indicating a higher final than initial mean. The quadratic contrast is \(q_2^\mathsf{T}\mu=10-2(14)+18=0\). These means rise at a constant rate across the three occasions, so there is no quadratic curvature.
For means \(10,15,12\), the linear contrast is \(-10+12=2\), while the quadratic contrast is \(10-2(15)+12=-8\). The negative quadratic value reflects a profile that bends downward relative to a straight-line pattern.
Worked Example: Four Occasions and a Linear Slope
For four equally spaced occasions, the centered coordinates are \((-1.5,-0.5,0.5,1.5)\). Convenient mutually orthogonal contrast vectors are \(q_1=(-3,-1,1,3)\), \(q_2=(1,-1,-1,1)\), and \(q_3=(-1,3,-3,1)\). Each sums to zero. For example, \(q_1^\mathsf{T}q_2=-3+1-1+3=0\), and \(q_1^\mathsf{T}q_3=3-3-3+3=0\); also \(q_2^\mathsf{T}q_3=-1-3+3+1=0\).
Let the means be \((12,15,19,24)\). The contrasts are
and
The positive linear component summarizes an upward trend; the small positive quadratic component describes a slight departure from a straight line, and the cubic component is zero. If the linear trend is expressed as the slope against the centered occasion coordinate \(x\), then \(q_1=2x\), and \(x^\mathsf{T}\mu=20\), \(x^\mathsf{T}x=5\). The least-squares linear slope is therefore \(20/5=4\) mean units per occasion step. The factor of two between \(q_1\) and \(x\) changes the contrast’s scale, not its trend pattern.
Worked Example: Five Occasions and a Pure Quadratic Profile
With five equally spaced occasions, centered coordinates are \((-2,-1,0,1,2)\). One mutually orthogonal set of contrast vectors is
Each sums to zero. Their pairwise inner products are zero: in order, \(q_1^\mathsf{T}q_2=0\), \(q_1^\mathsf{T}q_3=0\), \(q_1^\mathsf{T}q_4=0\), \(q_2^\mathsf{T}q_3=0\), \(q_2^\mathsf{T}q_4=0\), and \(q_3^\mathsf{T}q_4=0\). For example, \(q_2^\mathsf{T}q_4=2+4-12+4+2=0\).
Take means \(\mu=(4,7,8,7,4)\). The linear contrast is \(-8-7+0+7+8=0\). The quadratic contrast is \(q_2^\mathsf{T}\mu=8-7-16-7+8=-14\). The cubic contrast is \(4+14+0-14-4=0\), and the quartic contrast is \(4-28+48-28+4=0\). These means equal \(8-x_j^2\) at every occasion, so the profile is exactly quadratic. The contrast pattern isolates that curvature; the other polynomial components vanish.
What a Polynomial Contrast Measures
A contrast value is a signed combination of means, not a separate mean at an occasion. Its sign and size depend on the chosen coefficient orientation and scale. The shape of its coefficient vector gives its interpretation: linear coefficients compare early and late occasions in an ordered way; quadratic coefficients distinguish a bend from a straight trend; higher degrees represent progressively more complex departures.
The orthogonal vectors also give a coordinate representation of the profile. Suppose the mean vector has a representation \(\mu=\sum_{s=0}^{m}\beta_s q_s\), where \(m\le k-1\). Then each contrast \(q_r^\mathsf{T}\mu\) isolates one coefficient:
Proof. Taking the inner product with \(q_r\) gives
because mutual orthogonality makes every term with \(s\ne r\) zero. Since \(q_r\ne0\), its squared length \(q_r^\mathsf{T}q_r\) is positive, and division gives the stated coefficient. \(\square\)
The constant coordinate \(q_0\) represents the overall level. Since \(q_0\) is the vector of ones and each other \(q_r\) sums to zero, the coefficient of \(q_0\) is the average of the occasion means. The remaining coordinates describe the profile’s trend components around that level. With \(k\) occasions, the \(k-1\) contrast vectors span all possible mean-profile departures from a constant profile.
For observed data, replace the population means \(\mu_j\) with their estimated occasion means. The resulting contrast is an estimated trend component. Orthogonality here is a statement about the coefficient vectors under the ordinary inner product; by itself it does not guarantee that the estimated contrast values are statistically independent or uncorrelated. Those properties depend on the repeated-measure covariance structure.
Common Pitfalls
- Using familiar coefficient patterns without checking the number of occasions. A three-occasion quadratic contrast does not automatically serve as the quadratic contrast for five occasions. Construct vectors for the actual occasion count.
- Treating a contrast value as a slope. A contrast is a weighted sum. A slope requires a stated coordinate scale and an appropriate model or calculation; rescaling a contrast changes its numerical value.
- Calling any orthogonal contrasts independent. Zero inner product of coefficient vectors is algebraic orthogonality, not a general guarantee about the sampling distribution.
- Interpreting high-degree components as automatically meaningful trends. Higher-degree contrasts can represent complex profile departures, but their scientific usefulness depends on the planned question and the number and spacing of occasions.
Check Your Understanding
Use the contrast definitions and calculations above to answer these questions.
- Why does every polynomial vector \(q_r\) with \(r\ge1\) have coefficients that sum to zero?
- For three equally spaced occasions, calculate the linear and quadratic contrasts for means \((9,13,11)\). What does each value indicate?
- Explain why multiplying a contrast vector by a nonzero constant does not change the trend pattern it represents.
- For a mean vector represented by orthogonal polynomial vectors, why does taking its inner product with \(q_r\) isolate the coefficient of \(q_r\)?
- Does orthogonality of two contrast coefficient vectors by itself imply that their estimated contrast values are uncorrelated? Explain.