Tutorials › Multivariate Statistics (Graduate) › Parameterizing Linear Contrast Families

Simultaneous Multivariate Inference · Tutorial 213 of 975

Parameterizing Linear Contrast Families

Represent mean comparisons with a contrast matrix and use its rank to understand how many independent parameters the family targets.

Intermediate 10 min read

What You'll Learn

  • Express a prespecified family of linear mean comparisons as rows of a matrix.
  • Distinguish classical contrasts, whose coefficients sum to zero, from general linear functionals.
  • Compute the vector of contrast parameters from a mean vector.
  • Determine the dimension of the contrast target from the matrix rank.
  • Recognize when reported contrast coordinates are dependent or leave some mean directions unmeasured.
  • Understand how changing the basis of a contrast family changes its coordinates without changing its span.

From Mean Vectors to Contrast Parameters

In multivariate inference, a scientific question often concerns a small collection of comparisons among the components of a mean vector rather than every component separately. For example, an investigator may want to compare four treatment means in a sequence, or compare the average response in one group of conditions with the average response in another. A matrix gives a precise way to specify all such comparisons together.

Let \(\mu=(\mu_1,\ldots,\mu_p)^T\) be a \(p\)-dimensional mean vector. A row vector \(c^T=(c_1,\ldots,c_p)\) defines the linear functional \(c^T\mu=\sum_{k=1}^p c_k\mu_k\). In the classical treatment-means setting, a contrast is such a linear functional whose coefficients sum to zero. This condition makes the comparison unchanged if the same constant is added to every mean. More generally, a row that does not sum to zero still defines a linear functional, but is not a classical contrast under this convention.

Definition: A contrast matrix \(C\) is a specified \(q\times p\) matrix whose rows encode \(q\) linear functionals of the \(p\) mean components. The associated vector of target parameters is \(\eta=C\mu\). If every row of \(C\) sums to zero, the rows are classical contrasts. The rank \(r=\operatorname{rank}(C)\) is the number of linearly independent rows, and it determines the dimension of the set of possible values of \(C\mu\) as \(\mu\) varies over \(\mathbb{R}^p\).

Writing the questions as rows fixes their coefficients and order. If the \(j\)th row is \(c_j^T\), then the \(j\)th component of \(\eta\) is \(\eta_j=c_j^T\mu\). The components of \(\eta\) are the parameters being targeted; the number \(q\) of listed rows need not equal the number of independent target parameters.

Encoding a Family of Comparisons

Consider four treatment means. The adjacent differences can be recorded as three rows, each with a positive coefficient for the first mean in the comparison and a negative coefficient for the second:

$$ C= \begin{pmatrix} 1&-1&0&0\\ 0&1&-1&0\\ 0&0&1&-1 \end{pmatrix}, \qquad \eta=C\mu= \begin{pmatrix} \mu_1-\mu_2\\ \mu_2-\mu_3\\ \mu_3-\mu_4 \end{pmatrix}. $$

Each row sums to zero, so each is a classical contrast. The matrix records both the questions and their signs: reversing one row reverses the corresponding contrast parameter. Stating a convention for row order and signs prevents ambiguity when reporting results.

Worked Example: Adjacent Comparisons Among Four Means

Suppose \(\mu=(10,13,15,18)^T\), and use the adjacent-comparison matrix above. Calculate the contrast parameters and determine whether all three are independent.

Multiplication row by row gives \(\eta_1=10-13=-3\), \(\eta_2=13-15=-2\), and \(\eta_3=15-18=-3\). Thus \(\eta=(-3,-2,-3)^T\).

To check row independence, suppose a linear combination of the rows with coefficients \(a,b,c\) is zero. Its first coordinate is \(a\), so \(a=0\). Its second coordinate is \(-a+b\), so \(b=0\); its third coordinate is \(-b+c\), so \(c=0\). Only the zero combination gives the zero row. Therefore \(\operatorname{rank}(C)=3\), and the family has three independent target parameters.

A contrast matrix also makes it possible to tell whether some listed questions repeat information already contained in others. This matters when a family is described with more rows than it has independent directions.

Worked Example: A Listed Contrast That Is Redundant

For three means, consider the three pairwise differences \(\mu_1-\mu_2\), \(\mu_2-\mu_3\), and \(\mu_1-\mu_3\). Their matrix and target vector are

$$ C= \begin{pmatrix} 1&-1&0\\ 0&1&-1\\ 1&0&-1 \end{pmatrix}, \qquad C\mu= \begin{pmatrix} \eta_1\\ \eta_2\\ \eta_3 \end{pmatrix}. $$

The third row is the sum of the first two, so \(\eta_3=\eta_1+\eta_2\) for every \(\mu\). For \(\mu=(4,7,9)^T\), direct calculation gives \(\eta_1=4-7=-3\), \(\eta_2=7-9=-2\), and \(\eta_3=4-9=-5\); indeed, \(-5=-3+(-2)\).

The matrix has rank 2, not 3. For example, its first two rows are independent, while the third is their sum. Thus the three displayed comparisons are coordinates in a three-entry list, but they describe only a two-dimensional target.

Rank, Dimension, and Unmeasured Directions

The dimension statement follows from a basic fact about linear maps. The matrix \(C\) maps each possible mean vector in \(\mathbb{R}^p\) to a point \(C\mu\) in \(\mathbb{R}^q\). Its image, also called its column space, is the set of all such output vectors. The rank of \(C\) is the dimension of that image.

Theorem: For a \(q\times p\) real matrix \(C\), the possible contrast-parameter vectors \(\{C\mu:\mu\in\mathbb{R}^p\}\) form a linear subspace of \(\mathbb{R}^q\) with dimension \(\operatorname{rank}(C)\). Two mean vectors \(\mu\) and \(\tilde\mu\) give the same target vector if and only if \(\mu-\tilde\mu\) belongs to the null space of \(C\).

Proof. The set of possible outputs is the image of the linear map \(\mu\mapsto C\mu\). It is a subspace: if \(C\mu=u\) and \(C\tilde\mu=v\), then \(u+v=C(\mu+\tilde\mu)\), and for any scalar \(a\), \(au=C(a\mu)\). By the definition of matrix rank, the dimension of this image is \(\operatorname{rank}(C)\).

For the second claim, \(C\mu=C\tilde\mu\) holds exactly when subtracting the two sides gives \(C(\mu-\tilde\mu)=0\). This says precisely that \(\mu-\tilde\mu\) is in the null space of \(C\). Thus directions in the null space change the mean vector without changing the target parameters. By the rank-nullity theorem, that null space has dimension \(p-\operatorname{rank}(C)\). \(\square\)

When \(C\) has dependent rows, its target vectors satisfy linear constraints and occupy a proper subspace of \(\mathbb{R}^q\). When the rows are independent, the image has dimension \(q\), so there are no such constraints among the \(q\) coordinates. This is a statement about the parameterization, not a claim that the observed estimates or their uncertainty have any particular distribution.

Worked Example: Contrasts Leave the Overall Level Unmeasured

Let \(C=\begin{pmatrix}1&-1&0\\1&1&-2\end{pmatrix}\), and consider \(\mu=(5,8,11)^T\). Both rows sum to zero, and they are independent: the third coordinate of a linear combination of the rows is \(-2b\), forcing \(b=0\) if the combination is zero; the first coordinate then forces the coefficient \(a\) of the first row to be zero.

The target parameters are \(\eta_1=5-8=-3\) and \(\eta_2=5+8-2(11)=-9\). The rank is 2, so this pair of contrasts has a two-dimensional target. Yet it cannot determine all three means.

In fact, \(C(1,1,1)^T=(0,0)^T\). Adding any common constant \(a\) to the three means leaves both contrasts unchanged: \(C(\mu+a(1,1,1)^T)=C\mu+aC(1,1,1)^T=C\mu\). Since the null space has dimension \(3-2=1\), this common-shift direction accounts for the one mean direction not identified by these contrasts.

Choosing Coordinates for the Same Contrast Family

A family of contrasts can be represented using different rows that span the same row space. Changing the basis changes the numerical coordinates used to describe the family, but does not add or remove its independent directions. For an invertible \(r\times r\) matrix \(A\), replacing a full-row-rank matrix \(C\) by \(C^*=AC\) gives \(\eta^*=C^*\mu=A(C\mu)=A\eta\). The parameters have been re-expressed by an invertible transformation.

Result: If \(C\) has \(r\) independent rows and \(A\) is an invertible \(r\times r\) matrix, then \(C\) and \(AC\) have the same row space and the same rank. Their target vectors are related by the one-to-one transformation \(\eta^*=A\eta\).

Proof. Every row of \(AC\) is a linear combination of rows of \(C\), so the row space of \(AC\) is contained in the row space of \(C\). Since \(A^{-1}\) exists, \(C=A^{-1}(AC)\), so every row of \(C\) is also a linear combination of rows of \(AC\). The row spaces are therefore equal, and their dimensions, hence their ranks, are equal. Finally, \((AC)\mu=A(C\mu)\); invertibility of \(A\) makes this a one-to-one change of coordinates. \(\square\)

Worked Example: Re-Expressing Two Independent Comparisons

Take \(C\) with rows \((1,-1,0)\) and \((0,1,-1)\), and let \(A=\begin{pmatrix}1&1\\1&0\end{pmatrix}\). Its determinant is \(-1\), so \(A\) is invertible. The transformed matrix has rows \((1,0,-1)\) and \((1,-1,0)\): the total difference from the first mean to the third, followed by the first adjacent difference.

For \(\mu=(4,7,9)^T\), the original target is \(\eta=(4-7,7-9)^T=(-3,-2)^T\). The transformed target is \(A\eta=((-3)+(-2),-3)^T=(-5,-3)^T\), which agrees with direct evaluation of the transformed rows: \(4-9=-5\) and \(4-7=-3\). The coordinates differ, but both matrices represent the same two-dimensional row space and have rank 2.

Common Pitfall and Practical Use

Common mistake: Counting the rows and declaring that a family of \(q\) listed contrasts has \(q\) independent parameters. The three pairwise differences among three means are a counterexample: there are three rows, but the third contrast is the sum of the first two, so the rank is only 2. The correction is to check linear dependence, either by row reduction or by expressing rows as combinations, before interpreting the number of target dimensions.

Another useful check is whether a row really is a classical contrast. For example, \((1,1,0)\mu=\mu_1+\mu_2\) is a linear functional but its coefficients sum to 2, not 0. Adding a constant \(a\) to every mean changes this functional by \(2a\), so it is not a treatment contrast under the zero-sum convention. The row itself makes this distinction visible.

Parameterizing the target before inference clarifies exactly which mean features a later analysis concerns. It identifies the requested quantities, shows whether some are algebraically redundant, and records what changes in the mean vector cannot be detected by those quantities. The matrix does not by itself supply a confidence procedure or a test; it gives the parameter space that such procedures must address.

Key takeaway: Put each requested linear comparison in one row of \(C\), compute \(\eta=C\mu\), and use \(\operatorname{rank}(C)\) to count the independent target dimensions. The null space describes mean changes invisible to the chosen family.

Check Your Understanding

Use the matrix representation and rank ideas to answer these questions.

  1. For a contrast row \((2,-1,-1)\), verify whether the row defines a classical contrast and write its parameter in terms of \(\mu_1,\mu_2,\mu_3\).
  2. Three pairwise differences among three means are listed. Why can their number of rows not be used by itself to determine the target dimension?
  3. If \(C\) is a \(4\times 6\) matrix of rank 3, what is the dimension of its possible target vectors, and what is the dimension of its null space?
  4. What condition on a matrix \(A\) ensures that replacing a full-row-rank \(C\) by \(AC\) preserves its row space?
  5. Explain what it means, in terms of the null space of \(C\), for two mean vectors to give identical contrast parameters.
Clinical Biostats