Table : TABLE 14-17. Calculating the Within-Groups Sum of Squares The within-groups sum of squares is calculated the same way for a two-way ANOVA as for a one-way ANOVA. We take each score and subtract the mean of the cell from which it comes—not the grand mean—to create deviations; then we square the deviations and sum them: Σ(X − Mcell)2 = 0.018.