Sum of Squares in ANOVA
The three main sums of squares in one-way ANOVA are
$$ SST = \sum_{i=1}^{k}\sum_{j=1}^{n_i}\left(y_{ij} - \bar{y}_{\cdot\cdot}\right)^2, $$$$ SSTreat = \sum_{i=1}^{k} n_i \left(\bar{y}_{i\cdot} - \bar{y}_{\cdot\cdot}\right)^2, $$$$ SSE = \sum_{i=1}^{k}\sum_{j=1}^{n_i}\left(y_{ij} - \bar{y}_{i\cdot}\right)^2. $$They satisfy the ANOVA identity
$$ SST = SSTreat + SSE. $$Here $SSTreat$ measures between-treatment variation and $SSE$ measures within-treatment variation.