2.5 - Contrast Analysis

Unsurprisingly, paired comparison methods (presented in Sections 2.2 and 2.3) are limited to comparisons made only between treatment mean pairs. However, a contrast analysis procedure can be used to carry out comparisons of a much wider context, such as comparisons of treatment level groups or even testing of trends. In the context of a single-factor ANOVA model, a linear contrast can be defined as a linear combination of the treatment means such that their numerical coefficients add to zero. Mathematically, a contrast can be represented by

\(A=\sum_{i=1}^{T} a_{i} \bar{y}_{i}\)

where \(\bar{y}_{1}, \bar{y}_{2}, \ldots, \bar{y}_{T}\) represent the sample treatment means and \(\sum_{i=1}^{T} a_{i}=0\). The quantity A is a sample statistic and serves as an estimate for the parameter contrast \(\sum_{i=1}^{T} a_{i} \mu_{i}\). By choosing the numerical coefficients appropriately, linear contrasts can be used to make different comparisons among groups of treatment means, including but not limited to mean pairs. The table below gives 4 linear contrasts defined in terms of the 3 fertilizer levels, F1, F2, F3, and the Control in the greenhouse example.

Table: Greenhouse example contrasts
Ex \(a_1\) \(a_2\) \(a_3\) \(a_4\) Contrast
1 1 -1 0 0 F1-F2
2 1 1 1 -3 F1+F2+F3-3C
3 1 1 -2 0 F1+F2-2F3
4 0 1 -1 0 F2-F3

Notice that values of each list of \(a_{i}\) (i = 1, 2, 3, 4) add to zero. The first contrast compares the first two fertilizer types in terms of their means (a pairwise comparison), the second compares the means of the 3 fertilizer types with the Control mean. The 3rd one is a comparison between the combined effect of fertilizer types 1 and 2 with fertilizer type 3, while the last contrast compares the 2nd and 3rd fertilizer types.

A pair of contrasts \(A=\sum_{i=1}^{T} a_{i} \bar{y}_{i}\), and \(B=\sum_{i=1}^{T} b_{i} \bar{y}_{i}\) is orthogonal if the products of their numerical coefficients add to zero. This can be expressed mathematically as

\(\sum_{i=1}^{T} a_{i}b_{i}=0\)

A set of contrasts is said to be orthogonal if every pair of contrasts in the set is orthogonal. Two orthogonal contrasts are not correlated. This means that if A and B are orthogonal, then the Covariance (A, B) = 0.  Furthermore, the sum of squares of the treatment displayed usually in the ANOVA table, can be partitioned into a set of (T-1) orthogonal contrasts each with 1 degree of freedom. Note that the maximal number of orthogonal contrasts associated with the treatment of T levels is (T-1) and each of them would be associated with one specific comparison independent of the other. In the table above, contrasts 1, 2, and 3 form an orthogonal set of (T-1) contrasts. 

The statistical significance of a linear contrast, which can be equated to testing for the zero contrast value, can be formulated using the null and alternative hypotheses:

\(H_0\colon \sum_{i=1}^{T} a_{i} \mu_{i}=0 \text { vs. } H_A\colon  \sum_{i=1}^{T} a_{i} \mu_{i} \neq 0 \text {, }\)

and can be tested using either,

\(t=\dfrac{\sum_{i=1}^{T} a_{i} \bar{y}_{i}}{\sqrt{\operatorname{MSE} \sum_{i=1}^{T} \frac{a_{i}^{2}}{n_i}}}\) with (N-T) degrees of freedom or \(F=\dfrac{\left(\sum_{i=1}^{T} a_{i} \bar{y}_{i}\right)^{2}}{\operatorname{MSE} \sum_{i=1}^{T} \frac{a_{i}^{2}}{n_i}}\)

with the numerator and denominator degrees of freedom equal to 1 and (N-T) respectively.

Note that MSE can be obtained from the ANOVA table. Applying the above formula, the t- statistic for testing contrast 2 above is

\(t=\dfrac{\sum_{i=1}^{T} a_{i} \bar{y}_{i}}{\sqrt{\operatorname{MSE} \sum_{i=1}^{T}\frac{a_{i}^{2}}{n_i}}}=\dfrac{28.6+25.867+29.2-(3 * 21)}{\sqrt{3.052 \times \frac{(1+1+1+9)}{6}}}=8.365\)

with df=20 and has a p-value of approximately 0. This indicates that the average plant height due to the combined treatment of the 3 fertilizer types differs significantly from the average plant height yielded by the control.

The above testing procedure is applicable to non-orthogonal contrasts as well. However, as non-orthogonal contrasts are not guaranteed to be uncorrelated, the conclusions arrived at may be "overlapping", leading to redundancies. In Lesson 3, examples are provided to illustrate how software can be used to conduct contrast testing. The hypothesis testing for trends using contrasts will be discussed in Lesson 10 ANCOVA II.