Table : TABLE 12-6. Calculating the Within-Groups Sum of Squares The within-groups sum of squares is calculated by taking each score and subtracting the mean of the sample from which it comes—not the grand mean—to create deviations, then squaring the deviations and summing the squared deviations.