Tutorials › VEE Mathematical Statistics › Linear Contrasts of Group Means

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

Linear Contrasts of Group Means

Learn to read a contrast’s coefficient pattern and state precisely which comparison of population means it represents.

Advanced 10 min read

What You'll Learn

  • Define a contrast and check whether its coefficients sum to zero.
  • Interpret the sign and scale of a contrast in the units of the response.
  • Translate coefficient patterns into comparisons between group means.
  • Distinguish a contrast parameter from an observed sample calculation.
  • Recognize common traps involving coefficient order and group-size weighting.

What a Contrast Represents

A one-way ANOVA concerns several treatment or group means. A single omnibus comparison asks whether all the population means are equal, but many scientific questions are more specific: Is one treatment different from a control? Does the average response in two groups differ from the average in two other groups? Do responses tend to be larger at higher ordered dose levels? A linear contrast expresses such a question as a weighted sum of population means.

The weights, called coefficients, determine which means are compared. Their signs show which means contribute to each side of the comparison; their magnitudes determine the weighting. The contrast is a parameter defined from the population means, not a conclusion about whether a difference is statistically significant.

Definition: For \(k\) groups with population means \(\mu_1,\ldots,\mu_k\), a linear contrast is the parameter \[ L=\sum_{j=1}^{k}c_j\mu_j \] where the fixed coefficients \(c_1,\ldots,c_k\) satisfy \[ \sum_{j=1}^{k}c_j=0. \] The coefficients must be attached to the groups in a stated order. A linear combination whose coefficients do not sum to zero is not a contrast.

The zero-sum requirement ensures that the combination represents a comparison among means rather than depending on their common baseline. It does not require the coefficients to be integers, nor does it require every coefficient to be nonzero. For example, \( (1,-1,0) \) compares the first and second means and leaves the third out. Multiplying every coefficient by the same nonzero constant gives another contrast representing the same comparison on a different scale.

A contrast is defined using the population means. In a study, the means may describe the populations or treatment conditions under consideration; the interpretation must follow the study’s design and definitions of those groups. No distributional assumption is needed to define the parameter itself. Distributional assumptions matter for later inference about a contrast, not for deciding what the contrast means.

Reading the Coefficient Pattern

A practical way to interpret a contrast is to separate its positive and negative coefficients. Because all coefficients sum to zero, the sum of the positive coefficients equals the absolute sum of the negative coefficients. If this shared sum is \(W>0\), then

$$ L=\sum_{c_j>0}c_j\mu_j-\sum_{c_j<0}|c_j|\mu_j =W\left( \frac{\sum_{c_j>0}c_j\mu_j}{W} - \frac{\sum_{c_j<0}|c_j|\mu_j}{W} \right). $$

The expression in parentheses is a difference between two weighted averages: one formed from groups with positive coefficients and one formed from groups with negative coefficients. A coefficient of zero means that group does not enter the comparison. This reading is especially helpful when the coefficients are fractional or when several groups contribute to each side.

1
Write the group order.
List each population mean beside the group it represents, so the coefficients cannot be attached to the wrong groups.
2
Check the coefficient sum.
Add all coefficients. A sum of zero is necessary for the linear combination to be a contrast.
3
Read the signs and weights.
Identify which means are on the positive side, which are on the negative side, and how strongly each is weighted.
4
State the estimand in words.
Describe the comparison, its direction, and—if useful—its scale in response units.

Common Contrast Patterns

Several coefficient patterns appear frequently in comparisons of group means. The coefficient vector must always be read in the same order as the groups.

Coefficient patternInterpretationCondition or caution
\((-1,1)\)\(\mu_2-\mu_1\): group 2 minus group 1The order determines the sign.
\((-1,\frac{1}{2},\frac{1}{2})\)Average of groups 2 and 3 minus group 1Group 1 is compared with an equally weighted average.
\((-1,\frac{1}{3},\frac{1}{3},\frac{1}{3})\)Average of groups 2, 3, and 4 minus group 1The three comparison groups have equal weights.
\((1,-1,-1,1)\)\((\mu_1+\mu_4)-(\mu_2+\mu_3)\)Each side has total weight 2; divide by 2 if the desired comparison is between the two pair averages.
Coefficients proportional to centered ordered levelsA weighted comparison emphasizing higher versus lower levelsFor a trend interpretation, the groups must have a meaningful order; equally spaced levels support the usual linear pattern.

The coefficients describe a comparison of group means, not a comparison weighted automatically by the number of observations in each group. If the scientific question is the difference between two equally weighted group averages, the coefficients should represent those averages. Unequal group sizes do not by themselves change the definition of that estimand.

Why the Coefficients Must Sum to Zero

The zero-sum condition is more than a formal test. It makes the contrast unchanged if the same constant is added to every group mean. Suppose a common shift \(a\) is added, so that each mean becomes \(\mu_j+a\). Then

$$ \sum_{j=1}^{k}c_j(\mu_j+a) =\sum_{j=1}^{k}c_j\mu_j+a\sum_{j=1}^{k}c_j =\sum_{j=1}^{k}c_j\mu_j, $$

because \(\sum c_j=0\). Thus the contrast depends on differences among the means, not on an arbitrary common origin of the response scale. If the coefficients instead summed to a nonzero value, adding \(a\) to every mean would change the linear combination by \(a\sum c_j\); that combination would include a baseline component and would not be a contrast.

Worked Example: Comparing Two Pairs of Treatments

Method: identify the two weighted averages encoded by the coefficients. A hypothetical laboratory study compares four treatment protocols, with population mean response scores \(\mu_A=42\), \(\mu_B=50\), \(\mu_C=46\), and \(\mu_D=58\), in that order. Consider coefficients \((\frac12,\frac12,-\frac12,-\frac12)\). Interpret the contrast and calculate its value. The stated figures are hypothetical population means in score points; no probability distribution or interest or mortality assumption is needed to define this contrast.

Step 1: Check the contrast condition. The coefficients sum to \(\frac12+\frac12-\frac12-\frac12=0\), so they define a contrast.

Step 2: Translate the positive and negative sides. The positive coefficients give the average of protocols A and B: \((42+50)/2=92/2=46\). The negative coefficients give the average of protocols C and D: \((46+58)/2=104/2=52\).

Step 3: Subtract in coefficient order. The contrast is the first pair’s average minus the second pair’s average, so its value is \(46-52=-6\) score points.

Interpretation and check. The A/B average is 6 points lower than the C/D average. The negative sign agrees with the calculated averages. A common mistake is to describe this as the difference between A and C alone; that ignores B and D, which also have nonzero coefficients. The stated coefficient pattern compares the two pair averages.

Worked Example: One Treatment Versus the Average of Three Others

Method: verify the zero sum, then express the contrast as a treatment mean minus the average of the other means. In a hypothetical study of a new scheduling method, let the population mean completion times, in minutes, be 30 for the control and 36, 33, and 39 for programs P, Q, and R. Use coefficient order (control, P, Q, R) and coefficients \((-1,\frac13,\frac13,\frac13)\). Find and interpret the contrast. These are hypothetical population means; the contrast definition requires no assumed distribution.

Step 1: Verify the coefficients. Their sum is \(-1+\frac13+\frac13+\frac13=-1+1=0\).

Step 2: Identify the comparison. The contrast is \(-\mu_{\text{control}}+(\mu_P+\mu_Q+\mu_R)/3\), which is the average program time minus the control mean.

Step 3: Calculate both sides. The program average is \((36+33+39)/3=108/3=36\) minutes. The contrast is \(36-30=6\) minutes.

Interpretation and check. The average of the three program means is 6 minutes higher than the control mean. Since shorter completion time would be preferable in this hypothetical context, the positive value indicates a higher average time for the programs, not an improvement. A common mistake is to reverse the subtraction because one expects a treatment to be better; the coefficient signs, not an expectation, set the direction.

Worked Example: A Contrast Across Ordered Dose Levels

Method: use the ordered coefficient pattern to compare higher levels with lower levels, then verify its scale. A hypothetical experiment has four equally spaced dose levels, in order \(0,2,4,6\) units. The corresponding population mean responses are \(10,13,19,28\) units. Consider coefficients \((-3,-1,1,3)\). Calculate the contrast and explain what its sign and magnitude represent. The dose and response values are hypothetical; this parameter requires no distributional assumption.

Step 1: Check the sum and order. The coefficients sum to \(-3-1+1+3=0\). They are attached in increasing dose order, with negative weights at the lower levels and positive weights at the higher levels.

Step 2: Calculate the weighted sum. \[ L=(-3)(10)+(-1)(13)+(1)(19)+(3)(28) =-30-13+19+84=60. \]

Step 3: Interpret the scale. The positive weights sum to 4, as do the absolute negative weights. The positive-side weighted average is \((19+3(28))/4=(19+84)/4=25.75\). The negative-side weighted average is \((3(10)+13)/4=(30+13)/4=10.75\). Their difference is \(25.75-10.75=15\), and the original contrast is \(4(15)=60\).

Interpretation and check. The contrast is positive, so this coefficient pattern gives more weighted contribution to the higher-dose means. Its value is 60 in the scale of the unnormalized coefficients, or 15 response units when expressed as the difference between the two normalized weighted averages. A common mistake is to report 60 as an ordinary difference between two group means; it is the weighted sum, four times the corresponding difference of weighted averages.

Interpretation Traps

  • Reversing the group order. The vectors \((-1,1)\) and \((1,-1)\) both define contrasts, but they represent opposite directions. State the group order and the subtraction in words.
  • Checking only whether coefficients are present. A nonzero coefficient vector is not necessarily a contrast. For example, \((1,1,-1)\) sums to 1, so it fails the zero-sum condition.
  • Confusing a contrast with a general linear combination. Every contrast is a linear combination, but not every linear combination has coefficients summing to zero.
  • Ignoring coefficient scale. Scaling all coefficients preserves the basic comparison but scales the numerical contrast. Normalize weights when a difference between weighted averages is the clearest interpretation.
  • Weighting by sample sizes without a reason. Coefficients define the intended estimand. Do not substitute group sample sizes for the stated weights unless the target comparison itself calls for that weighting.
  • Calling an ordered pattern a trend without checking the order. A trend interpretation requires a meaningful ordering of the groups; a linear spacing interpretation also depends on the spacing of the levels.
Key takeaway: A linear contrast is a zero-sum weighted combination of population means. Check the coefficient sum, preserve the group order, and translate positive and negative weights into the comparison they encode. The coefficients determine the estimand; the numerical scale depends on how those coefficients are normalized.

Check Your Understanding

For each problem, use the group order provided, check whether the coefficients define a contrast, and interpret or calculate the requested comparison.

  1. A hypothetical three-arm study has ordered means \((14,20,23)\) for A, B, and C. Coefficients are \((-\frac12,1,-\frac12)\). Verify the zero-sum condition and calculate the contrast. (Answer: The coefficients sum to 0; the contrast is \(20-(14+23)/2=1.5\), so B is 1.5 response units above the average of A and C.)
  2. Four hypothetical group means, in order, are \((8,11,15,18)\). Find the contrast for the average of groups 1 and 2 minus the average of groups 3 and 4, and give its sign. (Answer: Coefficients \((\frac12,\frac12,-\frac12,-\frac12)\) sum to 0; the contrast is \(9.5-16.5=-7\), so the first pair average is 7 units lower.)
  3. A control has hypothetical mean 25, and three programs have means 31, 29, and 35, in that order after the control. For coefficients \((-1,\frac13,\frac13,\frac13)\), calculate the contrast exactly and interpret it. (Answer: The program average is \(95/3\); the contrast is \(95/3-25=20/3\), or \(6\frac23\) units, so the program average is higher.)
  4. Five equally spaced ordered levels have hypothetical means \((5,8,14,17,\,\text{not applicable})\) would not form a five-level data set; instead use four equally spaced levels with means \((5,8,14,17)\) and coefficients \((-3,-1,1,3)\). Check and calculate the contrast, then give the difference between its normalized weighted averages. (Answer: The four coefficients sum to 0; \(L=-15-8+14+51=42\). The positive and absolute negative weights each sum to 4, so the normalized weighted-average difference is \(42/4=10.5\) units.)
  5. Four hypothetical group means are \((12,9,10,14)\), in order. Do coefficients \((1,-2,1,0)\) define a contrast? Calculate it and explain what groups contribute. (Answer: Yes, \(1-2+1+0=0\); \(L=12-18+10=4\). It is \(\mu_1-2\mu_2+\mu_3\), with group 4 excluded.)
Clinical Biostats