Tutorials › Introduction to Statistics › Between-Group Sum of Squares

One-Way ANOVA · Tutorial 851 of 996

Between-Group Sum of Squares

Calculate between-group variation from group summaries, use the correctly weighted grand mean, and interpret the result in the response variable’s squared units.

Intermediate 9 min read

What You'll Learn

  • Define the between-group sum of squares and its role in one-way ANOVA.
  • Calculate it from group sizes, group means, and the grand mean.
  • Explain why each group’s contribution is weighted by its size.
  • Use the weighted grand mean when group sizes differ.
  • Interpret the result in squared units and identify what it does not establish.

What the Between-Group Sum of Squares Measures

A one-way ANOVA compares the means of several groups on a quantitative response. Before making an inferential comparison, it is useful to describe how far the group means lie from the overall mean. The between-group sum of squares measures that variation: a group mean farther from the grand mean contributes more, and a group containing more observations contributes more for the same distance.

For example, suppose several hypothetical groups have average waiting times that differ. The between-group sum of squares summarizes how much the groups’ average waiting times vary around the overall average waiting time. It describes variation associated with differences among group means; by itself, it does not establish why those means differ or whether the differences are statistically significant.

Definition: For \(k\) nonempty groups, let \(n_i\) be the size of group \(i\), \(\bar{x}_i\) its sample mean, and \(\bar{x}\) the grand mean across all observations. The between-group sum of squares, also called the treatment sum of squares, is $$ SS_{\text{between}}=SS_{\text{treatment}}=\sum_{i=1}^{k} n_i(\bar{x}_i-\bar{x})^2. $$ Each group’s squared distance from the grand mean is multiplied by the number of observations in that group.

The group index \(i\) runs from 1 to \(k\). The grand mean is the mean of all observations together, so when group sizes differ it is a weighted mean of the group means:

$$ \bar{x}=\frac{\sum_{i=1}^{k} n_i\bar{x}_i}{\sum_{i=1}^{k} n_i}. $$

The result is measured in squared units of the response. If the response is measured in minutes, \(SS_{\text{between}}\) is in minutes squared. It is not itself an average difference between groups or a percentage. Its size is most useful as a component of the variation accounting used in ANOVA.

Why Group Size Appears in the Formula

The factor \(n_i\) is not an arbitrary adjustment. A group mean represents all \(n_i\) observations in that group. If the group mean is a certain distance from the grand mean, that distance is counted once for each observation represented by the group.

To see this directly, label the observations in group \(i\) by \(x_{ij}\), where \(j=1,\ldots,n_i\). Every observation in that group is assigned the same group mean when describing the group’s location. The sum of squared distances of those group means from the grand mean, counted over all observations, is

$$ \sum_{i=1}^{k}\sum_{j=1}^{n_i}(\bar{x}_i-\bar{x})^2 =\sum_{i=1}^{k}n_i(\bar{x}_i-\bar{x})^2. $$

The inner expression does not depend on \(j\), so adding it \(n_i\) times gives \(n_i(\bar{x}_i-\bar{x})^2\). Summing across groups gives the between-group sum of squares. This argument also shows why a larger group has a larger contribution when its mean is equally far from the grand mean.

Because each term is a group size multiplied by a squared distance, every contribution is nonnegative. If all groups are nonempty, \(SS_{\text{between}}=0\) exactly when every group mean equals the grand mean. If at least one group mean differs, the sum is positive.

Calculating the Sum of Squares

A reliable calculation keeps the group sizes, group means, and grand mean visible. First check that the grand mean is based on all observations, not merely on an unweighted average of the group means. Then find each difference \(\bar{x}_i-\bar{x}\), square it, multiply by \(n_i\), and add the contributions.

Worked Example: Equal-Size Groups

Suppose three hypothetical groups of students complete a timed task. Their completion times have group means of 12, 15, and 18 seconds, and each group contains 4 students. Calculate and interpret the between-group sum of squares.

The group sizes are equal, so the grand mean is the mean of the three group means:

$$ \bar{x}=\frac{4(12)+4(15)+4(18)}{4+4+4} =\frac{180}{12}=15\text{ seconds}. $$

Now apply the formula, keeping the group size attached to each squared difference:

$$ \begin{aligned} SS_{\text{between}} &=4(12-15)^2+4(15-15)^2+4(18-15)^2\\ &=4(9)+4(0)+4(9)\\ &=72\text{ seconds}^2. \end{aligned} $$

The value is \(72\text{ seconds}^2\). It summarizes how far the three group means lie from the overall mean, counting each group’s mean displacement for its four students. It does not say that an individual student’s completion time is 72 seconds from the grand mean.

Worked Example: Unequal Group Sizes

In a hypothetical measurement exercise, three groups have sizes 5, 10, and 15, with mean measurements of 20, 24, and 28 units. Find \(SS_{\text{between}}\).

Because the sizes are unequal, calculate the grand mean by weighting each group mean by its group size:

$$ \bar{x}=\frac{5(20)+10(24)+15(28)}{5+10+15} =\frac{760}{30} =\frac{76}{3}\approx25.33\text{ units}. $$

The distances from the grand mean are \(20-\frac{76}{3}=-\frac{16}{3}\), \(24-\frac{76}{3}=-\frac{4}{3}\), and \(28-\frac{76}{3}=\frac{8}{3}\). Weight each squared distance by its group size:

$$ \begin{aligned} SS_{\text{between}} &=5\left(-\frac{16}{3}\right)^2 +10\left(-\frac{4}{3}\right)^2 +15\left(\frac{8}{3}\right)^2\\ &=\frac{1280}{9}+\frac{160}{9}+\frac{960}{9}\\ &=\frac{2400}{9} =\frac{800}{3} \approx266.7\text{ units}^2. \end{aligned} $$

The third group’s mean is only \(\frac{8}{3}\) units above the grand mean, but its size of 15 is the largest. Its contribution, \(15(\frac{8}{3})^2\approx106.7\text{ units}^2\), is therefore substantial. Both the distance and the number of observations matter.

The Grand Mean Must Respect the Group Sizes

When all group sizes are equal, the unweighted average of the group means happens to equal the grand mean. With unequal sizes, it generally does not: each group mean represents a different number of observations. Using the unweighted average changes the center of the calculation and does not produce the between-group sum of squares defined above.

Worked Example: Checking a Proposed Calculation

Three hypothetical groups have sample sizes 4, 8, and 8, and mean scores of 10, 14, and 16 points. A student uses the unweighted mean, \((10+14+16)/3=13.33\), as the grand mean. Calculate the correct between-group sum of squares and identify the error.

The correct grand mean weights each group mean by its size:

$$ \bar{x}=\frac{4(10)+8(14)+8(16)}{4+8+8} =\frac{280}{20}=14\text{ points}. $$

Using this center gives

$$ \begin{aligned} SS_{\text{between}} &=4(10-14)^2+8(14-14)^2+8(16-14)^2\\ &=4(16)+8(0)+8(4)\\ &=96\text{ points}^2. \end{aligned} $$

The unweighted mean of 13.33 points gives the smaller groups’ means the same influence as the mean of the group containing eight observations, even though the groups do not contain the same number of observations. Using 13.33 in the formula would yield about \(104.9\text{ points}^2\), which is not the between-group sum of squares for these data. The correction is to use the weighted grand mean, 14 points, before calculating the group contributions.

Interpreting the Result Carefully

A larger between-group sum of squares means that the group means, considered together and weighted by group sizes, are more dispersed around the grand mean in the response variable’s squared units. A value of zero means the observed group means are all identical. A positive value indicates that at least one observed group mean differs from the grand mean.

The raw value depends on the scale of measurement and the number of observations. For instance, changing a response from meters to centimeters multiplies each deviation by 100 and therefore multiplies the sum of squared deviations by \(100^2=10{,}000\). Adding more observations in groups with means away from the grand mean can also increase the sum. Thus, a number such as 96 is not meaningful without its units and data context, and raw between-group sums of squares should not be compared casually across different scales or sample sizes.

The term “treatment sum of squares” is standard in ANOVA, but “treatment” does not guarantee that groups were assigned experimentally. Groups may instead be categories observed in existing data. The calculation describes differences among their means; whether those differences can be given a causal interpretation depends on how the data were collected, not on this formula.

Key takeaway: Calculate \(SS_{\text{between}}\) by multiplying each group’s squared distance from the weighted grand mean by that group’s size, then adding the contributions. The result describes variation among group means, in squared response units; it is not by itself a significance test or a causal conclusion.

Common Mistakes

  • Using an unweighted grand mean for unequal groups. Averaging the group means equally ignores how many observations each represents. Use \(\bar{x}=\frac{\sum n_i\bar{x}_i}{\sum n_i}\).
  • Forgetting the group-size multiplier. Summing only \((\bar{x}_i-\bar{x})^2\) treats each group as if it had size one. Include \(n_i\) in every term.
  • Failing to square the differences. Unsquared positive and negative deviations can cancel. The formula uses squared deviations, so every group contributes a nonnegative quantity.
  • Reporting the response’s original units. If measurements are in points, the sum of squares is in points squared.
  • Calling the result evidence of a significant or causal difference. The sum of squares is a descriptive quantity. It does not, on its own, provide a p-value or establish causation.

Check Your Understanding

Try these questions using the definition and calculations above.

  1. Two groups have sizes 6 and 6 and means of 8 and 12 minutes. What is the grand mean and the between-group sum of squares?
  2. Why does a group of 20 observations contribute more than a group of 5 observations when both group means are the same distance from the grand mean?
  3. Three groups have sizes 2, 4, and 6. What information is needed to calculate their grand mean correctly?
  4. If all group means are equal, what is \(SS_{\text{between}}\)? Explain why.
  5. A response is recorded in kilograms. What are the units of its between-group sum of squares, and what does the result describe?