Tutorials › Multivariate Statistics (Graduate) › Sphericity in Contrast Coordinates

Contrasts and Repeated Measures · Tutorial 371 of 975

Sphericity in Contrast Coordinates

Learn to express sphericity in contrast coordinates, check it from a covariance matrix, and understand the assumptions behind the univariate repeated-measures F reference distribution.

Advanced 10 min read

What You'll Learn

  • Define sphericity using the variances of unit-length within-subject contrasts.
  • Express sphericity as a scalar-identity condition on a contrast covariance matrix.
  • Prove that the condition is invariant to the choice of orthonormal contrast basis.
  • Check sphericity directly in worked covariance-matrix examples.
  • Derive the classical univariate repeated-measures F distribution under sphericity and normality.
  • Recognize why covariance departures can invalidate the usual univariate F calibration.

Why Sphericity Is a Contrast-Covariance Condition

In a repeated-measures design, each subject contributes measurements on \(m\) occasions or conditions. The within-subject questions concern differences among those occasions, not a subject’s overall level. A contrast removes that overall level: its coefficients sum to zero. But different contrasts can have different variances, and the classical univariate repeated-measures test treats the contrast directions as though they share one common variance.

Sphericity is the covariance condition that makes this treatment appropriate. It is a statement about all directions in the within-subject contrast space, not about the variances of the original measurements one at a time. A convenient way to express it is to transform the measurements to orthonormal contrast coordinates and inspect their covariance matrix.

Definition: Let \(Y=(Y_1,\ldots,Y_m)^T\) be a subject’s measurement vector, with covariance matrix \(\Sigma\). A within-subject contrast vector \(a\in\mathbb{R}^m\) satisfies \(a^T\mathbf{1}=0\), where \(\mathbf{1}\) is the \(m\)-vector of ones. Sphericity holds if there is a common value \(\lambda\) such that \( \operatorname{Var}(a^T Y)=\lambda \) for every unit-length within-subject contrast \(a\), meaning \(a^T a=1\). Equivalently, for any matrix \(C\) whose \(m-1\) rows are an orthonormal basis of the contrast space, sphericity holds when \( C\Sigma C^T=\lambda I_{m-1} \).

For a nondegenerate repeated-measures model, \(\lambda>0\). The matrix \(C\) has \(m-1\) rows, satisfies \(C\mathbf{1}=0\), and satisfies \(CC^T=I_{m-1}\). The transformed response \(Z=CY\) consists of the coordinates of \(Y\) along these contrast directions, and covariance propagation gives \(\operatorname{Cov}(Z)=C\Sigma C^T\). Sphericity therefore means equal variances in these coordinates and zero covariances between distinct orthonormal contrast coordinates.

Why the Condition Does Not Depend on the Contrast Basis

There are many possible orthonormal bases for the same contrast space. Changing from one such basis to another rotates the contrast coordinates; it does not change whether they have a common variance. This matters because a numerical check should not depend on which valid orthonormal contrast matrix was selected.

Theorem: The following statements are equivalent: (1) every unit-length within-subject contrast has variance \(\lambda\); (2) \(C\Sigma C^T=\lambda I_{m-1}\) for one orthonormal contrast matrix \(C\); and (3) this matrix equation holds for every orthonormal contrast matrix \(C\).

Proof. Write \(d=m-1\). The columns of \(C^T\) are an orthonormal basis for the \((m-1)\)-dimensional subspace perpendicular to \(\mathbf{1}\). Thus every unit contrast \(a\) can be written \(a=C^T x\) for a unit vector \(x\in\mathbb{R}^d\), and every unit \(x\) gives such a contrast. Its variance is \(a^T\Sigma a=x^T(C\Sigma C^T)x\). If this equals \(\lambda\) for every unit \(x\), let \(A=C\Sigma C^T\). Taking \(x=e_j\), the \(j\)th coordinate vector, shows \(A_{jj}=\lambda\). For \(j\ne k\), taking \(x=(e_j+e_k)/\sqrt{2}\) shows \((A_{jj}+A_{kk}+2A_{jk})/2=\lambda\), and hence \(A_{jk}=0\). Therefore \(A=\lambda I_d\). Conversely, if \(A=\lambda I_d\), then \(x^TAx=\lambda\) for every unit \(x\), so every unit contrast has variance \(\lambda\).

Now let \(C_*\) be any other orthonormal contrast matrix with the same contrast space. Its rows are another orthonormal basis, so there is an orthogonal \(d\times d\) matrix \(Q\) such that \(C_*=QC\). Therefore \(C_*\Sigma C_*^T=Q(C\Sigma C^T)Q^T\). If \(C\Sigma C^T=\lambda I_d\), the right side is \(Q(\lambda I_d)Q^T=\lambda I_d\). The condition thus holds for every orthonormal contrast basis. \(\square\)

Worked Example: A Spherical Covariance Matrix for Three Occasions

Consider three occasions and the orthonormal contrast matrix \(C=\begin{pmatrix}1/\sqrt{2}&-1/\sqrt{2}&0\\1/\sqrt{6}&1/\sqrt{6}&-2/\sqrt{6}\end{pmatrix}\). Suppose \(\Sigma=2I_3+\frac{1}{3}\mathbf{1}\mathbf{1}^T\). Check sphericity.

Each row of \(C\) sums to zero, and the rows have unit length and inner product zero. Thus \(C\) is an orthonormal contrast matrix. Since \(C\mathbf{1}=0\), \(C\Sigma C^T=2CC^T+\frac{1}{3}(C\mathbf{1})(C\mathbf{1})^T\). Here \(CC^T=I_2\) and the second term is zero, so \(C\Sigma C^T=2I_2\). Sphericity holds with common contrast variance \(\lambda=2\).

The original measurement variances are the diagonal entries of \(\Sigma\), each \(2+\frac13=\frac73\). Those entries alone do not establish sphericity: the condition concerns the covariance of contrast coordinates. In this example, the added covariance component in the \(\mathbf{1}\) direction disappears after applying \(C\).

Checking Sphericity in Contrast Coordinates

For a chosen orthonormal contrast basis, the calculation is direct: form \(C\Sigma C^T\), then check whether all diagonal entries are equal and all off-diagonal entries are zero. A different orthonormal basis may produce different individual coordinates, but the theorem ensures that it cannot change the conclusion.

Worked Example: A Covariance Matrix That Is Not Spherical

Let \(m=3\), let \(\Sigma=\operatorname{diag}(1,4,1)\), and use the same contrast matrix as in the previous example. Calculate the contrast covariance and decide whether sphericity holds.

The variance of the first contrast is \(\frac12(1)+\frac12(4)=\frac52\). The variance of the second contrast is \(\frac16(1)+\frac16(4)+\frac46(1)=\frac32\). The covariance between the two contrast coordinates is \((1/\sqrt{2})(1/\sqrt{6})(1)+(-1/\sqrt{2})(1/\sqrt{6})(4)=-3/\sqrt{12}=-\sqrt{3}/2\). Therefore \(C\Sigma C^T=\begin{pmatrix}5/2&-\sqrt{3}/2\\-\sqrt{3}/2&3/2\end{pmatrix}\).

This matrix is not a scalar multiple of \(I_2\): its diagonal entries differ, and its off-diagonal entries are nonzero. Hence sphericity fails. The unequal variances already suffice to rule it out; the nonzero covariance also shows that the displayed orthonormal contrast coordinates are not uncorrelated.

A common mistake is to compare only the occasion-specific variances \(\operatorname{Var}(Y_j)\) and conclude that equal variances imply sphericity. The calculation above illustrates why that reasoning is inadequate: the contrast covariance depends on the full \(\Sigma\), including its covariances. The reverse shortcut is also invalid: unequal occasion-specific variances alone do not prove a violation, because covariance contributions can combine to give a scalar contrast covariance matrix, as in the preceding example.

Role in the Univariate Repeated-Measures F Test

The classical univariate repeated-measures analysis treats the \(m-1\) contrast directions as a common-variance set. Under sphericity and multivariate normality, its usual F statistic has the familiar central F reference distribution under the null hypothesis of no occasion effect. The next derivation makes the assumptions and the source of the degrees of freedom explicit.

Theorem: Suppose \(Y_1,\ldots,Y_n\) are independent subject measurement vectors with a common multivariate normal distribution \(N_m(\mu,\Sigma)\). Let \(C\) be an orthonormal contrast matrix with \(d=m-1\) rows, and suppose \(C\Sigma C^T=\lambda I_d\), where \(\lambda>0\). Under the null hypothesis \(C\mu=0\), define \(Z_i=CY_i\) and \(\bar Z=n^{-1}\sum_{i=1}^n Z_i\). Then the classical univariate repeated-measures statistic \(F=\{n\bar Z^T\bar Z/d\}\big/\{\sum_{i=1}^n(Z_i-\bar Z)^T(Z_i-\bar Z)/[(n-1)d]\}\) has an \(F_{d,(n-1)d}\) distribution.

Proof. Each \(Z_i\) is multivariate normal with mean \(C\mu=0\) under the null and covariance \(C\Sigma C^T=\lambda I_d\). Put the \(n\) row vectors \(Z_i^T\) into an \(n\times d\) matrix. Apply an orthogonal transformation to its rows whose first row is \(\mathbf{1}^T/\sqrt n\). The first transformed row is \(\sqrt n\,\bar Z^T\); the remaining \(n-1\) rows give orthogonal residual coordinates.

Because the subjects are independent and each contrast coordinate has covariance matrix \(\lambda I_d\), the transformed rows are jointly normal, each with covariance \(\lambda I_d\), and have zero cross-covariances. Joint normality makes these rows independent. The squared length of the first row divided by \(\lambda\) is therefore \(\chi^2_d\). Orthogonal transformation preserves the sum of squared residuals, so the sum of squared lengths of the remaining rows divided by \(\lambda\) is \(\chi^2_{(n-1)d}\). These two quantities are independent.

Consequently, the numerator mean square divided by \(\lambda\) is \(\chi^2_d/d\), and the denominator mean square divided by \(\lambda\) is \(\chi^2_{(n-1)d}/[(n-1)d]\). Their ratio is \(F_{d,(n-1)d}\), because the common factor \(\lambda\) cancels. \(\square\)

Worked Example: Reading the Univariate F Degrees of Freedom

Suppose \(n=8\) independent subjects are measured on \(m=3\) occasions. Assume multivariate normal subject vectors, sphericity, and the null hypothesis of no occasion effect. A repeated-measures analysis reports occasion sum of squares \(12\) and subject-by-occasion residual sum of squares \(28\). Calculate the F statistic and its reference degrees of freedom.

There are \(d=m-1=2\) contrast coordinates. The occasion mean square is \(12/2=6\). The residual degrees of freedom are \((n-1)d=7\cdot2=14\), so the residual mean square is \(28/14=2\). Thus \(F=6/2=3\), with reference distribution \(F_{2,14}\) under the stated assumptions.

The calculation of the ratio is mechanical; its reference distribution is not assumption-free. Sphericity supplies a common variance across contrast directions, while multivariate normality and independent subjects justify the exact chi-square and independence steps in the proof.

Interpretation and a Practical Caution

Sphericity is relevant because the univariate test pools contrast-direction variation into one error mean square and uses numerator and denominator degrees of freedom based on \(m-1\). If the contrast covariance is not \(\lambda I_{m-1}\), those directions do not share a common variance. The exact derivation above then no longer applies: dividing by a pooled mean square does not, in general, produce the stated central F distribution under the null.

This does not mean that the data have no interpretable within-subject effects, nor does it mean that the contrast means themselves are invalid. It means specifically that the usual univariate F calibration needs the stated covariance condition for its standard exact justification. Sphericity is a covariance assumption for the within-subject contrast space, not a claim that the occasion means are equal and not a claim that the original measurements are independent.

Key takeaway: Choose any orthonormal basis for the within-subject contrast space and compute \(C\Sigma C^T\). Sphericity holds exactly when this matrix is a positive scalar times the identity. Under independent multivariate normal subject vectors and the null hypothesis, that condition gives the classical univariate repeated-measures F reference distribution.

Check Your Understanding

Answer each question using contrast coordinates rather than relying only on the occasion-specific variances.

  1. What two matrix conditions must an orthonormal within-subject contrast matrix \(C\) satisfy when there are \(m\) occasions?
  2. Why does \(C\Sigma C^T=\lambda I\) imply that every unit-length within-subject contrast has variance \(\lambda\)?
  3. If one orthonormal contrast basis gives a scalar-identity covariance matrix, can another orthonormal basis give a nonscalar matrix? Explain.
  4. For \(n=10\) subjects measured on four occasions, what are the numerator and denominator degrees of freedom of the classical univariate F test under the theorem’s assumptions?
  5. Which assumptions in the F-distribution derivation are not guaranteed by sphericity alone?
Clinical Biostats