Why Decompose Multivariate Scatter?
In a one-way multivariate design, each observational unit has several measured responses and belongs to one of several groups. The total variation in the response vectors has two sources: observations vary around their own group means, and the group means vary around the overall mean. Separating these sources gives a matrix-valued accounting identity, preserving variation in every response and the cross-products between responses.
This decomposition is descriptive and algebraic: it does not by itself test whether group means differ, nor does it require a distributional model. Its interpretation depends on the design, however. The groups must partition the observations, and the overall mean must weight each observation equally.
Definitions for a One-Way Multivariate Design
Suppose there are \(k\) nonempty groups and \(p\) responses. Group \(g\) contains \(n_g\) observed response vectors \(x_{gi}\in\mathbb{R}^p\), for \(i=1,\ldots,n_g\). Write \(N=\sum_{g=1}^k n_g\), and treat each response vector as a column vector. The sample mean in group \(g\) and the overall sample mean are
For a vector \(u\), the outer product \(uu'\) is a \(p\times p\) matrix. It records squared deviations on the diagonal and cross-products off the diagonal.
The factor \(n_g\) in \(B\) matters: group \(g\)'s mean represents \(n_g\) observations. Thus a group with more observations contributes more to the between-group scatter when its mean is a given distance from the grand mean.
The Total Scatter Decomposition
Proof. For each observation, add and subtract its group mean:
Set \(a_{gi}=x_{gi}-\bar{x}_g\) and \(d_g=\bar{x}_g-\bar{x}\). Expanding the outer product gives
Sum over observations and groups. The first terms sum to \(W\). For the cross-products, the within-group deviations sum to zero in every group:
Consequently, \(\sum_g\sum_i a_{gi}d_g'=0\), and its transpose \(\sum_g\sum_i d_ga_{gi}'\) is also zero. The remaining terms sum to
Therefore \(T=W+B\). \(\square\)
What the Matrices Measure
Each diagonal element of \(T\) is the total sum of squared deviations for one response; the corresponding diagonal elements of \(W\) and \(B\) split that total into within-group and between-group sums of squares. For two distinct responses \(r\) and \(s\), the \((r,s)\) entry is a sum of cross-products of their deviations. It can be positive, negative, or zero. The same decomposition holds for these cross-products, not just for the diagonal sums of squares.
All three matrices are positive semidefinite: for any vector \(c\in\mathbb{R}^p\), for example,
The same argument applies to \(W\) and \(B\). This also shows that each matrix describes sums of squared deviations after projecting the response vectors onto any chosen direction \(c\). A negative off-diagonal entry does not contradict positive semidefiniteness; that condition applies to the whole quadratic form, not to every individual entry.
Worked Example: Two Groups With Two Responses
Group 1 contains \((1,2)'\) and \((3,2)'\); group 2 contains \((4,4)'\) and \((4,6)'\). Calculate all three scatter matrices.
The group means are \(\bar{x}_1=(2,2)'\) and \(\bar{x}_2=(4,5)'\), so the grand mean is \(\bar{x}=(3,3.5)'\). In group 1, the deviations from its mean are \((-1,0)'\) and \((1,0)'\). Their outer products sum to
In group 2, the deviations are \((0,-1)'\) and \((0,1)'\), giving \(W_2=\begin{pmatrix}0&0\\0&2\end{pmatrix}\). Hence \(W=W_1+W_2=\begin{pmatrix}2&0\\0&2\end{pmatrix}\).
The group-mean deviations from the grand mean are \((-1,-1.5)'\) and \((1,1.5)'\). Each group has size two, so
Thus \(T=W+B=\begin{pmatrix}6&6\\6&11\end{pmatrix}\). The first response's total sum of squares is \(6=2+4\); the second's is \(11=2+9\). The total cross-product is \(6\), entirely due here to the separation between group means.
Unequal Group Sizes and a Pairwise Expression
The grand mean is the observation-weighted mean of the group means. An unweighted average of group means is generally wrong when group sizes differ. The following equivalent expression for \(B\) makes the weighting and the role of group separation explicit.
Derivation. Using \(\sum_g n_g\bar{x}_g=N\bar{x}\), expand the definition of \(B\):
Now expand the numerator of the proposed pairwise expression. For each unordered pair \(g<h\), its outer product is
In the sum over all pairs, the coefficient of \(\bar{x}_g\bar{x}_g'\) is \(n_g\sum_{h\ne g}n_h=n_g(N-n_g)\), while the cross terms include each ordered pair \(g\ne h\) once. Equivalently, the entire pairwise sum is
Dividing by \(N\) gives the expanded expression for \(B\), proving the identity. \(\square\)
Worked Example: Unequal Group Sizes
Group 1 has observations \((0,0)'\) and \((2,0)'\). Group 2 has \((3,1)'\), \((3,3)'\), and \((3,5)'\). The group sizes are two and three, and their means are \(\bar{x}_1=(1,0)'\) and \(\bar{x}_2=(3,3)'\). Therefore the grand mean is
Within group 1, the deviations \((-1,0)'\) and \((1,0)'\) give \(W_1=\begin{pmatrix}2&0\\0&0\end{pmatrix}\). Within group 2, the deviations \((0,-2)'\), \((0,0)'\), and \((0,2)'\) give \(W_2=\begin{pmatrix}0&0\\0&8\end{pmatrix}\). Thus \(W=\begin{pmatrix}2&0\\0&8\end{pmatrix}\).
The mean deviations from the grand mean are \((-1.2,-1.8)'\) and \((0.8,1.2)'\). Weighting their outer products by the group sizes yields
Consequently \(T=\begin{pmatrix}6.8&7.2\\7.2&18.8\end{pmatrix}\). The trace of \(W\) is \(10\), the trace of \(B\) is \(15.6\), and the trace of \(T\) is \(25.6=10+15.6\). As a check using the pairwise expression, there is just one pair of groups: \(\bar{x}_1-\bar{x}_2=(-2,-3)'\), so
Scatter Is Not Covariance
A scatter matrix is an unnormalized sum of outer products. It is not itself a covariance matrix. For example, the overall sample covariance matrix is \(T/(N-1)\). Within each group, the usual sample covariance is \(W_g/(n_g-1)\) when \(n_g>1\), where \(W_g\) is that group's contribution to \(W\). Dividing by a denominator changes the scale and the target; the identity \(T=W+B\) is an identity between scatter matrices, not a claim that covariance matrices add with the same denominators.
Worked Example: Within-Group Cross-Products and Between-Group Separation
Group 1 contains \((0,0)'\) and \((2,2)'\), while group 2 contains \((4,0)'\) and \((6,2)'\). The group means are \((1,1)'\) and \((5,1)'\), and the grand mean is \((3,1)'\).
In each group, the two deviations from its mean are \((-1,-1)'\) and \((1,1)'\). Their outer products sum to \(\begin{pmatrix}2&2\\2&2\end{pmatrix}\), so the two groups together give \(W=\begin{pmatrix}4&4\\4&4\end{pmatrix}\).
The group-mean deviations from the grand mean are \((-2,0)'\) and \((2,0)'\). With two observations per group,
Therefore \(T=\begin{pmatrix}20&4\\4&4\end{pmatrix}\). The positive off-diagonal entries of \(W\) and \(T\) arise from the within-group tendency for the two responses to deviate in the same direction; the between-group separation here is only in the first response. The trace check is \(24=8+16\).
Common Mistakes
- Giving every group mean equal weight. The unweighted average of group means equals the grand mean only when the group sizes are equal. Use \(\bar{x}=\sum_g n_g\bar{x}_g/N\).
- Leaving out the group-size factor in \(B\). Each group's mean represents \(n_g\) observations, so its outer product receives weight \(n_g\).
- Assuming the cross-products must be positive. Off-diagonal entries are signed sums; their signs describe the direction of paired deviations. Positive semidefiniteness does not require every entry to be nonnegative.
- Calling \(T\), \(W\), or \(B\) a covariance matrix. These are sums, not averages. State the divisor when a covariance estimate is intended.
- Treating the identity as a statistical test. The decomposition holds for the observed vectors regardless of whether the group means are equal. Inference requires additional modeling and a separate inferential procedure.
Check Your Understanding
Use the definitions and decomposition to answer the following.
- In the one-way multivariate design, why does the cross-product term vanish when the total scatter is expanded?
- What does the \((r,s)\) entry of a within-group scatter matrix measure when \(r\ne s\)?
- When group sizes differ, why is the grand mean not generally the unweighted average of the group means?
- For the unequal-size example, verify that the pairwise expression gives the same between-group scatter matrix.
- Explain why a negative off-diagonal entry in a scatter matrix does not imply that the matrix is not positive semidefinite.