Tutorials › ANOVA › Autoregressive Covariance and Sphericity

Sphericity and Covariance · Tutorial 438 of 595

Autoregressive Covariance and Sphericity

Learn how AR(1) correlations determine the covariance matrix and why, with three or more conditions, sphericity holds only when the lag correlation is zero.

Advanced 9 min read

What You'll Learn

  • Write an equal-variance AR(1) covariance matrix for ordered repeated measurements.
  • Interpret how the AR(1) parameter determines correlations at different lags.
  • Calculate the variance of a within-subject difference from its lag.
  • Determine when an AR(1) covariance pattern satisfies sphericity.
  • Distinguish exact sphericity from a pattern that is only approximately spherical.

Why Covariance Across Conditions Matters

In repeated-measures ANOVA, the same subject is measured under several conditions. The measurements from one subject are therefore related, and the way they vary together affects the variances of within-subject differences. Sphericity is a condition on those difference variances: they must be equal for every pair of conditions. A covariance pattern can have the same variance at every condition and still fail this requirement.

An autoregressive, or AR(1), covariance pattern gives a specific way to describe that dependence. It assumes that measurements closer together in an ordered sequence have stronger correlation, with the correlation declining according to the distance, or lag, between them. We will build the corresponding covariance matrix and use pairwise difference variances to decide whether the pattern is spherical.

The Equal-Variance AR(1) Covariance Model

Suppose each of \(n\) subjects is measured under \(k\) ordered conditions. Write \(Y_{ij}\) for the outcome of subject \(i\) at condition \(j\), and let \(\varepsilon_{ij}=Y_{ij}-\mu_j\) denote the deviation from the population mean at that condition. For the covariance calculations, consider the vector of deviations for one subject, \(\boldsymbol{\varepsilon}_i=(\varepsilon_{i1},\ldots,\varepsilon_{ik})^\mathsf{T}\).

Definition: An equal-variance AR(1) covariance model assumes that each condition has the same marginal variance, \(\sigma^2\), and that the correlation between two measurements depends on their lag. For conditions \(j\) and \(\ell\), \[ \operatorname{Corr}(\varepsilon_{ij},\varepsilon_{i\ell})=\rho^{|j-\ell|}, \qquad \operatorname{Cov}(\varepsilon_{ij},\varepsilon_{i\ell})=\sigma^2\rho^{|j-\ell|}, \] where \(-1<\rho<1\). The model is applied to measurements from a subject; subjects are assumed independent of one another.

Here the lag is \(|j-\ell|\), the number of condition steps separating two measurements. The correlation is \(\rho\) at lag 1, \(\rho^2\) at lag 2, and \(\rho^h\) at lag \(h\). A positive \(\rho\) gives positive correlations that decline with lag. A negative \(\rho\) produces alternating signs: correlations at odd lags are negative and those at even lags are positive, while their magnitudes decline.

The AR(1) model is most naturally used when the conditions have a meaningful order and are equally spaced in time or another measurement scale. If the spacing is irregular, using the index difference as the lag may not represent the actual distance between measurements. The model also imposes more than equal marginal variances: the correlations must follow the particular geometric pattern \(\rho^h\).

For \(k\) conditions, the covariance matrix for one subject is therefore

$$ \boldsymbol{\Sigma} = \sigma^2 \begin{pmatrix} 1 & \rho & \rho^2 & \cdots & \rho^{k-1}\\ \rho & 1 & \rho & \cdots & \rho^{k-2}\\ \rho^2 & \rho & 1 & \cdots & \rho^{k-3}\\ \vdots & \vdots & \vdots & \ddots & \vdots\\ \rho^{k-1} & \rho^{k-2} & \rho^{k-3} & \cdots & 1 \end{pmatrix}. $$

The diagonal entries are all \(\sigma^2\). Entries one step from the diagonal are \(\sigma^2\rho\); entries two steps away are \(\sigma^2\rho^2\); and so on. The restriction \(-1<\rho<1\) gives a valid, nonsingular AR(1) covariance matrix. For example, it can be generated by a stationary process in which each deviation depends on the preceding deviation with coefficient \(\rho\), plus an independent innovation with variance \(\sigma^2(1-\rho^2)\). This construction has marginal variance \(\sigma^2\) and lag-\(h\) covariance \(\sigma^2\rho^h\).

Worked Example: Building a Four-Condition AR(1) Matrix

Suppose a hypothetical repeated-measures outcome has marginal variance \(\sigma^2=16\) outcome-units squared, and the AR(1) parameter is \(\rho=0.5\). There are four equally spaced conditions. Find the covariance matrix.

The correlations at lags 0, 1, 2, and 3 are \(1\), \(0.5\), \(0.5^2=0.25\), and \(0.5^3=0.125\). Multiplying each correlation by the marginal standard deviation squared, \(16\), gives the corresponding covariances. Thus,

$$ \boldsymbol{\Sigma} = 16 \begin{pmatrix} 1 & 0.5 & 0.25 & 0.125\\ 0.5 & 1 & 0.5 & 0.25\\ 0.25 & 0.5 & 1 & 0.5\\ 0.125 & 0.25 & 0.5 & 1 \end{pmatrix} = \begin{pmatrix} 16 & 8 & 4 & 2\\ 8 & 16 & 8 & 4\\ 4 & 8 & 16 & 8\\ 2 & 4 & 8 & 16 \end{pmatrix}. $$

For example, the covariance between conditions 1 and 3 is \(16(0.5^2)=4\) outcome-units squared, because they are two steps apart. The covariance between conditions 2 and 3 is \(16(0.5)=8\) outcome-units squared, because they are one step apart. The equal diagonal entries confirm equal marginal variances, but do not by themselves establish sphericity.

Variances of Pairwise Differences

For any two conditions \(j\) and \(\ell\), the variance of their difference follows from the variance rule for a difference of two random variables. Each measurement has variance \(\sigma^2\), and their covariance is \(\sigma^2\rho^{|j-\ell|}\). Therefore,

$$ \begin{aligned} \operatorname{Var}(Y_{ij}-Y_{i\ell}) &=\operatorname{Var}(\varepsilon_{ij}-\varepsilon_{i\ell})\\ &=\operatorname{Var}(\varepsilon_{ij})+\operatorname{Var}(\varepsilon_{i\ell}) -2\operatorname{Cov}(\varepsilon_{ij},\varepsilon_{i\ell})\\ &=2\sigma^2-2\sigma^2\rho^{|j-\ell|}\\ &=2\sigma^2\left(1-\rho^{|j-\ell|}\right). \end{aligned} $$

The mean values \(\mu_j\) do not enter this variance calculation: subtracting constants does not change variance. The result depends on the pair's lag, not on its particular location in the sequence. For lag \(h\), every such difference has variance \(2\sigma^2(1-\rho^h)\).

Definition: Sphericity holds when the variances of all pairwise within-subject differences are equal: \[ \operatorname{Var}(Y_{ij}-Y_{i\ell}) \] must have the same value for every distinct pair of conditions \(j\) and \(\ell\). It is a condition on the covariance structure, not on the condition means.

Worked Example: Difference Variances With Positive Autocorrelation

Return to the hypothetical four-condition model with \(\sigma^2=16\) and \(\rho=0.5\). Calculate the difference variances for lags 1, 2, and 3, and assess sphericity.

At lag 1, such as between conditions 1 and 2, \[ \operatorname{Var}(Y_{i1}-Y_{i2}) =2(16)(1-0.5)=32(0.5)=16 \] outcome-units squared.

At lag 2, such as between conditions 1 and 3, \[ \operatorname{Var}(Y_{i1}-Y_{i3}) =2(16)(1-0.5^2)=32(0.75)=24 \] outcome-units squared.

At lag 3, between conditions 1 and 4, \[ \operatorname{Var}(Y_{i1}-Y_{i4}) =2(16)(1-0.5^3)=32(0.875)=28 \] outcome-units squared.

These values differ: \(16\), \(24\), and \(28\) outcome-units squared. The covariance pattern therefore violates sphericity. Equal variances at each individual condition do not prevent the differences from having unequal variances; here, the correlations change with lag, which changes the difference variances.

When Does an AR(1) Pattern Satisfy Sphericity?

With at least three conditions, the set of pairs includes pairs at both lag 1 and lag 2. Under sphericity, their difference variances must be equal. Applying the AR(1) formula gives the necessary equality

$$ 2\sigma^2(1-\rho)=2\sigma^2(1-\rho^2). $$

Because \(\sigma^2>0\), divide both sides by \(2\sigma^2\), subtract 1 from each side, and rearrange:

$$ 1-\rho=1-\rho^2 \quad\Longrightarrow\quad \rho=\rho^2 \quad\Longrightarrow\quad \rho(1-\rho)=0. $$

The algebraic solutions are \(\rho=0\) and \(\rho=1\). But a nonsingular AR(1) covariance model requires \(-1<\rho<1\), so \(\rho=1\) is excluded. If \(\rho=0\), every nonzero-lag correlation is zero and every pairwise difference variance is \(2\sigma^2\). Thus zero is both necessary and sufficient for sphericity when there are at least three conditions.

Theorem: For an equal-variance AR(1) covariance model with \(k\geq 3\) and \(-1<\rho<1\), sphericity holds if and only if \(\rho=0\). When \(\rho=0\), all measurements from a subject are uncorrelated across distinct conditions, and every pairwise difference has variance \(2\sigma^2\).

The necessity follows because lag-1 and lag-2 pairs must have equal difference variances. The sufficiency follows because, at \(\rho=0\), \(\rho^h=0\) for every positive lag \(h\), so every pair gives \(2\sigma^2(1-0)=2\sigma^2\). For two conditions there is only one pairwise difference variance to compare, so this argument does not apply; that case is not a test of equality across multiple pair types.

Worked Example: Checking the Sphericity Condition Algebraically

A hypothetical study measures each subject under three equally spaced conditions. The assumed AR(1) marginal variance is \(\sigma^2=9\) outcome-units squared, and \(\rho=0.2\). Determine whether the model is spherical by comparing the two possible lags.

For a lag-1 pair, such as conditions 1 and 2, \[ \operatorname{Var}(Y_{i1}-Y_{i2}) =2(9)(1-0.2)=18(0.8)=14.4 \] outcome-units squared.

For the lag-2 pair, conditions 1 and 3, \[ \operatorname{Var}(Y_{i1}-Y_{i3}) =2(9)(1-0.2^2)=18(0.96)=17.28 \] outcome-units squared. Since \(14.4\neq17.28\), sphericity fails. This agrees with the general result: \(\rho=0.2\) is nonzero, so an AR(1) covariance pattern with three or more conditions is not spherical.

If instead \(\rho=0\) while \(\sigma^2=9\), both lag-1 and lag-2 difference variances would equal \(2(9)=18\) outcome-units squared. That model would satisfy sphericity exactly.

What the Result Does—and Does Not—Say

The result is specific to the equal-variance AR(1) pattern. It does not say that all covariance matrices with correlations that decline over time must violate sphericity, nor that sphericity requires compound symmetry. It says that if correlations follow exactly \(\rho^h\), marginal variances are equal, and there are at least three conditions, then any nonzero \(\rho\) produces unequal pairwise difference variances.

This matters when interpreting a repeated-measures ANOVA. The usual uncorrected within-subject \(F\) test relies on sphericity for its reference degrees of freedom when there are more than two conditions. An AR(1) pattern with nonzero \(\rho\) is a clear theoretical example where equal marginal variances alone are not enough to justify that assumption. This covariance calculation identifies the structural issue; it does not, by itself, determine whether a particular sample departs from sphericity substantially.

In data, the population covariance parameters are not usually known exactly. Sample covariance entries vary from sample to sample, so a matrix estimated from a modest number of subjects will not necessarily display an exact AR(1) pattern even if that model is a reasonable description. Conversely, a visually declining sequence of sample correlations is not proof that the population follows AR(1). The calculation here is a property of the stated model, not a substitute for assessing uncertainty in estimated covariance.

Common Mistake

  • Wrong reasoning: “All conditions have the same variance, so sphericity holds.” Equal diagonal entries of the covariance matrix establish equal marginal variances, not equal variances of all pairwise differences.
  • Correction: Calculate or compare \(2\sigma^2(1-\rho^h)\) across the lags that occur. With at least three conditions, lag 1 and lag 2 are both present; under the valid equal-variance AR(1) model, their difference variances are equal only when \(\rho=0\).

A related mistake is to treat “correlations decline with lag” as if it meant “difference variances are equal.” The formula shows the opposite mechanism: different lag correlations generally produce different difference variances. In this model, zero correlation at every positive lag is the special case that makes all those variances match.

Key takeaway: An equal-variance AR(1) model has covariance \(\sigma^2\rho^{|j-\ell|}\), so a difference across lag \(h\) has variance \(2\sigma^2(1-\rho^h)\). With three or more conditions and \(-1<\rho<1\), this pattern is spherical exactly when \(\rho=0\).

Check Your Understanding

Answer each question using the AR(1) covariance model and the definition of sphericity.

  1. For four conditions with \(\sigma^2=10\) and \(\rho=0.3\), write the covariance between conditions 1 and 4.
  2. For the same model, calculate the variance of a within-subject difference at lag 2.
  3. Explain why equal marginal variances do not establish sphericity for a nonzero-\(\rho\) AR(1) model.
  4. For \(k\geq3\), show which two lags give the equality used to determine when an AR(1) model can be spherical.
  5. What is the difference variance for every pair when \(\rho=0\), in terms of \(\sigma^2\)?
Clinical Biostats