Tutorials › VEE Mathematical Statistics › Orthogonality of Contrasts

VEE Mathematical Statistics · ANOVA Contrasts and Comparisons · Tutorial 817 of 880

Orthogonality of Contrasts

Use the group sizes to determine whether two contrasts are orthogonal, and avoid applying the balanced-design shortcut to unequal groups.

Advanced 10 min read

What You'll Learn

  • Define a contrast of group means and identify its coefficients.
  • Derive the covariance condition for two contrasts to be orthogonal.
  • Apply the coefficient dot-product rule when all group sizes are equal.
  • Use the reciprocal-sample-size weighting required for unequal group sizes.
  • Detect when an unweighted calculation gives the wrong conclusion.

Why Orthogonality Depends on the Design

A contrast compares group means using coefficients that sum to zero. In a one-way analysis of variance, two contrasts can be orthogonal: their estimated values have covariance zero under the common-variance model. The test is straightforward when every group has the same sample size, but unequal group sizes change the calculation. In that case, the coefficients must be weighted by the reciprocal group sizes.

The distinction matters because a contrast is estimated from sample means, and the precision of each sample mean depends on its group size. A mean based on a larger group has smaller variance. Thus, a check that ignores group sizes may declare two contrasts orthogonal when they are not, or miss orthogonality that is present.

Definition: For \(k\) groups with population means \(\mu_1,\ldots,\mu_k\), a contrast is a linear combination \(L=\sum_{i=1}^k c_i\mu_i\) whose coefficients satisfy \(\sum_{i=1}^k c_i=0\). Its estimator is \(\widehat L=\sum_{i=1}^k c_i\bar Y_i\), where \(\bar Y_i\) is the sample mean in group \(i\). Two contrasts with coefficient vectors \(c\) and \(d\) are orthogonal in a one-way ANOVA design when \(\operatorname{Cov}(\widehat L_c,\widehat L_d)=0\) under the model assumptions.

The zero-sum condition is essential: it makes a contrast a comparison among group means rather than a combination that also depends on an arbitrary common location. Orthogonality is a separate property. Two valid contrasts need not be orthogonal.

The Orthogonality Condition

Use the one-way ANOVA model in which observations in group \(i\) are independent with mean \(\mu_i\) and common variance \(\sigma^2\). The group sample sizes \(n_i\) are fixed, observations are independent across groups, and each group mean has variance \(\sigma^2/n_i\). Normality, when assumed for exact ANOVA inference, is not needed for this covariance calculation; the stated independence and common-variance conditions are what give the formula below.

Theorem: Under the one-way common-variance model, contrasts with coefficients \(c_i\) and \(d_i\) are orthogonal exactly when \(\sum_{i=1}^k c_i d_i/n_i=0\). If every group has the same size \(n\), this reduces to the ordinary coefficient dot product \(\sum_{i=1}^k c_i d_i=0\).

The unequal-size condition is a weighted inner product: the contribution from group \(i\) is divided by \(n_i\). This is not an arbitrary adjustment. It follows directly from the sampling covariance of the two estimated contrasts.

$$ \operatorname{Cov}(\widehat L_c,\widehat L_d) = \operatorname{Cov}\left(\sum_{i=1}^k c_i\bar Y_i,\sum_{i=1}^k d_i\bar Y_i\right) = \sum_{i=1}^k c_i d_i\operatorname{Var}(\bar Y_i) = \sigma^2\sum_{i=1}^k\frac{c_i d_i}{n_i}. $$

To justify the middle equality, expand the covariance of the two sums. Terms involving different group means are zero because observations from different groups are independent. The term from group \(i\) is \(c_i d_i\operatorname{Var}(\bar Y_i)\), and \(\operatorname{Var}(\bar Y_i)=\sigma^2/n_i\). Since \(\sigma^2\) is positive, the covariance is zero exactly when the weighted sum of coefficient products is zero.

When all sizes equal \(n\), the covariance becomes \((\sigma^2/n)\sum_i c_i d_i\). The factor \(\sigma^2/n\) is positive, so only the unweighted dot product needs to be checked. With unequal sizes, there is no common factor that can be removed from every term, so the weights must remain.

Worked Orthogonality Checks

Worked Example: Two Contrasts in a Balanced Design

A hypothetical experiment compares four groups, with \(n_i=6\) observations per group. Assume independent observations with \(Y_{ij}\sim N(\mu_i,36)\) for every group and observation. Consider contrasts with coefficients \(c=(1,1,-1,-1)\) and \(d=(1,-1,1,-1)\). Determine whether they are orthogonal.

Method. First verify that both coefficient sets define contrasts: \(\sum_i c_i=1+1-1-1=0\), and \(\sum_i d_i=1-1+1-1=0\).

Because the design is balanced, calculate the ordinary dot product: \(c\cdot d=(1)(1)+(1)(-1)+(-1)(1)+(-1)(-1)=1-1-1+1=0\).

As a covariance check, the model gives \(\operatorname{Cov}(\widehat L_c,\widehat L_d)=36(0/6)=0\). The contrasts are therefore orthogonal. The result does not depend on the unknown group means.

Check. Both coefficient sums are zero, and the covariance is zero. A common mistake avoided here is checking only that the coefficient sets are contrasts; the separate dot-product check is still required.

Worked Example: Orthogonality Despite a Nonzero Dot Product

A hypothetical study has three groups with sample sizes \(n_1=4\), \(n_2=6\), and \(n_3=8\). Assume independent observations with \(Y_{ij}\sim N(\mu_i,25)\). For \(c=(1,-1,0)\) and \(d=(2,3,-5)\), determine whether the contrasts are orthogonal.

Method. Verify the contrast conditions: \(1-1+0=0\) and \(2+3-5=0\). Since the sample sizes differ, use the weighted condition rather than the balanced-design shortcut.

Calculate each weighted term: \(c_1d_1/n_1=(1)(2)/4=1/2\), \(c_2d_2/n_2=(-1)(3)/6=-1/2\), and \(c_3d_3/n_3=(0)(-5)/8=0\). The weighted sum is \(1/2-1/2+0=0\).

Thus, \(\operatorname{Cov}(\widehat L_c,\widehat L_d)=25(0)=0\), so the contrasts are orthogonal. The unweighted dot product is \(2-3+0=-1\), which is not zero. That does not contradict the result: in an unequal-size design, the unweighted dot product is not the orthogonality test.

Check. The weighted sum vanishes, while the ordinary dot product does not. The mistake avoided is treating the unequal-size design as balanced.

Worked Example: A Zero Dot Product That Is Not Enough

A hypothetical three-group experiment has sample sizes \(n_1=2\), \(n_2=4\), and \(n_3=8\). Assume independent observations with \(Y_{ij}\sim N(\mu_i,16)\). Consider \(c=(1,-1,0)\) and \(d=(1,1,-2)\). Are the contrasts orthogonal?

Method. Confirm the coefficient sums: \(1-1+0=0\) and \(1+1-2=0\). Both coefficient sets define contrasts. Their ordinary dot product is \((1)(1)+(-1)(1)+(0)(-2)=1-1+0=0\), but the sample sizes are unequal, so this is not sufficient.

Apply the weighted condition: \(c_1d_1/n_1=1/2\), \(c_2d_2/n_2=-1/4\), and \(c_3d_3/n_3=0\). The weighted sum is \(1/2-1/4+0=1/4\), not zero.

The covariance is \(16(1/4)=4\), so the contrasts are not orthogonal. The zero ordinary dot product would have led to a wrong conclusion. The correction is to use each group’s own sample size in the denominator.

Check. The calculated covariance is nonzero, as required by the weighted condition. The trap avoided is using the balanced-design rule just because the unweighted coefficient products cancel.

A Reliable Procedure

A disciplined calculation prevents two separate errors: forgetting to check that the coefficient sets are contrasts, and using the wrong orthogonality rule for the design. The following sequence works for both balanced and unbalanced one-way ANOVA designs.

1
Record the coefficients and group sizes.
Match \(c_i\) and \(d_i\) to the same group \(i\), and record \(n_i\) beside them. Do not reorder one coefficient list without making the same change to the other lists and sizes.
2
Verify both contrast conditions.
Calculate \(\sum_i c_i\) and \(\sum_i d_i\). Each must equal zero; otherwise the corresponding linear combination is not a contrast.
3
Choose the appropriate orthogonality calculation.
For unequal sizes, calculate \(\sum_i c_i d_i/n_i\). For equal sizes, the common denominator can be omitted, so calculate \(\sum_i c_i d_i\).
4
State the conclusion.
A zero result means the estimated contrasts have covariance zero under the model. A nonzero result means they are not orthogonal under that design.

Keep the coefficient order consistent throughout. For example, if the second and third groups are swapped in one coefficient vector but not in the group-size list, the calculation no longer refers to the intended contrasts. Also retain exact fractions or decimals until the weighted sum is evaluated; rounding intermediate terms can obscure cancellation.

What Orthogonality Does—and Does Not—Say

For a specified one-way ANOVA design, orthogonality is a property of the contrasts together with the group sample sizes. It is not determined by the observed group means, and it does not depend on the numerical values of the coefficients’ common scale: multiplying one contrast’s coefficients by a nonzero constant multiplies the covariance by that constant but does not change whether it is zero.

The calculation is tied to the assumptions used to obtain \(\operatorname{Var}(\bar Y_i)=\sigma^2/n_i\) and independence between group means. If group variances differ, or observations are dependent across groups, this covariance formula need not apply. In such settings, a zero weighted coefficient sum using \(1/n_i\) is not by itself a valid orthogonality conclusion.

Key takeaway: For coefficients on group means, use \(\sum_i c_i d_i/n_i=0\) in an unequal-size one-way ANOVA. Only when all group sizes are equal does this reduce to the ordinary dot-product test.

Check Your Understanding

For each problem, first check that both coefficient vectors sum to zero. Then use the design-appropriate orthogonality condition.

  1. A balanced design has four groups of size 5. The contrast coefficients are \(c=(1,-1,0,0)\) and \(d=(1,1,-1,-1)\). Are the contrasts orthogonal? (Answer: Yes; the dot product is \(1-1+0+0=0\).)
  2. A design has group sizes \((3,6,9)\), with coefficients \(c=(1,-1,0)\) and \(d=(2,4,-6)\). Are the contrasts orthogonal? (Answer: Yes; the weighted sum is \(2/3-4/6+0=0\).)
  3. For group sizes \((2,5,10)\), let \(c=(1,-1,0)\) and \(d=(1,1,-2)\). If the common variance is \(10\), are the contrasts orthogonal, and what is the covariance of their estimates? (Answer: No; the weighted sum is \(1/2-1/5=3/10\), so the covariance is \(10(3/10)=3\).)
  4. A design has sizes \((4,4,8)\), with \(c=(1,1,-2)\) and \(d=(1,-1,0)\). Are the contrasts orthogonal? (Answer: Yes; the weighted sum is \(1/4-1/4+0=0\).)
  5. A design has sizes \((2,4,6)\), with \(c=(1,-1,0)\) and \(d=(2,1,-3)\). If the common variance is \(8\), are the contrasts orthogonal, and what is the covariance of their estimates? (Answer: No; the weighted sum is \(2/2-1/4+0=3/4\), so the covariance is \(8(3/4)=6\).)
Clinical Biostats