# Splitting of treatment sum of squares in ANOVA

An apparently classic mantra appearing in about a dozen of ANOVA textbooxs i consulted reads roughly as: given any choice of $T-1$ orthogonal contrasts $C_1, \cdots, C_{T-1}$ in a (not necessarily balanced) $T$-groups (one-way) ANOVA design, the treatment (or "between-groups") sum of squares $SS_{Treat}$ can be decomposed as the sum $\sum_{j=1}^{T-1}SS_{C_j}$ of contrasts $C_j$ sums of squares.

I think it would be helpful to have a proof of this fact or a reference to one, as most textbooks seem to lack.

I do not know if of any help, but here are some of the definitions of the statistics involved: let $\overline{Y}_i$ be the mean of the $n_i$ observations in the $i$-th group and $\overline{Y}$ the mean of all the observations; then

--a contrast is a linear combination $\sum_{i=1}^{T} \lambda_i\overline{Y}_i$ such that $\lambda_i\in \mathbb{R}$ and $\sum_i\lambda_i=0$;

--if two contrasts have coefficients $\lambda_i$ and $\nu_i$ such that $\sum_i\lambda_i\nu_i/n_i=0$, they are said to be orthogonal;

--sum of squares are defined as: $SS_{Treat}=\sum_{k=1}^Tn_k(\overline{Y}_k-\overline{Y})^2$ and $SS_C=\dfrac{C^2}{\sum_{i=1}^T\frac{\lambda_i^2}{n_i}}$

thanks a lot.

We let $C$ denote a contrast such as $C=\sum_{i=1}^T\lambda_i\bar{Y}_i$ and the vector $C=(\lambda_1,\cdots,\lambda_t)$. Define $C_0=\sum_{i=1}^Tn_i\bar{Y}_i$. Therefore, $C=\{C_0,C_1,\cdots,C_{T-1}\}$ forms an orthogonal basis for $\mathrm{R}^T$, with respect to the inner product $$\langle C_a,C_b\rangle=\sum_{i=1}^T\frac{\lambda_i^a\lambda_i^b}{n_i}.$$
Then, by the Parseval's identity, for any vector $M\in\mathrm{R}^T$, $$\|M\|^2 = \sum_{i=0}^{T-1}\frac{\langle C_i,M\rangle^2}{\langle C_i,C_i\rangle}.$$ Define $M=(n_1\bar{Y}_1,\cdots,n_T\bar{Y}_T)$, and check that for this specific $M$ we have, $$SS_{C_i}=\frac{\langle C_i,M\rangle^2}{\langle C_i,C_i\rangle}\;\;\;\text{for }i =0,\cdots,T.$$ Therefore, since $\|M\|^2=\sum_{i=1}^Tn_i\bar{Y}_i^2$, $$\sum n_i\bar{Y}_i^2=N\bar{Y}^2+\sum_{i=1}^{T-1}SS_{C_i},$$ where $N=n_1+\cdots+n_T$ and we let $SS_{C_0}=N\bar{Y}^2$.Therefore, $$\sum_{i=1}^{T-1}SS_{C_i}=\sum_{i=1}^Tn_i\bar{Y}^2_i-N\bar{Y}^2=\sum_{i=1}^Tn_i(\bar{Y}-\bar{Y}_i)^2=SS_{treat}.$$
• The fact that $C$ forms a basis follows from the fact that coordinates of $C_1,\cdots,C_{T-1}$ add up to zero. So every linear combination of them has this property. But $C_0$ does not have this property. Therefore $C_0$ is orthogonal to $C_1,\cdots,C_{T-1}$. On the other hand, every $T$ orthogonal vectors form a basis for $\mathrm{R}^T$.
• The Parseval's identity states that for orthonormal basis $\{v_i\}$, we have $$\|M\|^2=\sum\langle v_i,M\rangle.$$ To apply this to the orthogonal basis $C$, you can first divide the vector to their length to get the orthonormal basis $\{\frac{C_0}{\sqrt{\langle C_0,C_0\rangle}},\cdots,\frac{C_{T-1}}{\sqrt{\langle C_{T-1},C_{T-1}\rangle}}\}$
• note that $\|M\|^2$ is not the Euclidean length. It is the length defined by the inner product.