Sum of Squares vs Variance

Both terms below come up in the same part of the course, and students mix them up. Here is each one defined on its own, side by side, so you can see where they part company.

Sum of squares

Describing data

The sum of squares is the total of the squared deviations from the mean, and it is the numerator that sits on top of the variance formula.

The sum of squares adds up each observation's squared distance from the mean: SS=(xixˉ)2\text{SS} = \sum (x_i - \bar{x})^2, where xix_i are the values and xˉ\bar{x} (x-bar) is their mean. Squaring is what stops the raw deviations from cancelling, since they always add to zero. The result is never negative and it is in squared units, so it is a step inside a calculation rather than a number you report.

For 10, 12, 15, 19 the mean is 56/4=1456/4 = 14. The deviations are -4, -2, 1, and 5, their squares are 16, 4, 1, and 25, and SS=46\text{SS} = 46. Divide by n1=3n - 1 = 3 and the sample variance is s2=15.33s^2 = 15.33; take the square root and the sample standard deviation is s=3.92s = 3.92.

The name invites the wrong calculation, and "square each value and add them up" is the version to name out loud. For those four numbers that gives 100+144+225+361=830100 + 144 + 225 + 361 = 830, not 46. The squaring happens after the subtraction, never before it. Anything called a sum of squares in statistics is a sum of squared distances from something, and in this formula that something is the mean.

The mean is not an arbitrary reference point either. The quantity (xic)2\sum (x_i - c)^2 is smallest when c=xˉc = \bar{x}: for those four values, c=13c = 13 and c=15c = 15 each give 50, while c=14c = 14 gives 46. That is the property least-squares regression generalizes when it picks the line that minimizes the sum of squared residuals.

One boundary catches people out. SS is not itself a measure of spread, because it grows with the number of observations. Write those same four values twice, 10, 10, 12, 12, 15, 15, 19, 19, and the spread has not changed while SS doubles to 92. Only after dividing by n1n - 1 does the number describe the data instead of the size of the data set. SS reaches 0 in exactly one situation: every value equals the mean, which means every value is the same.

Full entry for sum of squares

Variance

Describing data

The variance measures spread from squared distances to the mean, dividing their total by n - 1 for a sample and by n for a population.

Variance measures spread by adding up the squared distances from every value to the mean and then dividing. For a sample:

s2=1n1(xixˉ)2s^2 = \frac{1}{n-1}\sum (x_i - \bar{x})^2

Read s2s^2 as s squared, where xix_i are the observations, xˉ\bar{x} (x bar) is the sample mean and nn is the sample size. For a full population the symbol becomes σ2\sigma^2 (sigma squared), the mean becomes μ\mu (mu), and the divisor is the population size rather than n1n - 1.

Work through 6, 9, 10, 12, 13. The mean is 10, so the deviations are -4, -1, 0, 2 and 3. Squared, those are 16, 1, 0, 4 and 9, summing to 30. Treated as a sample, s2=30/4=7.5s^2 = 30 / 4 = 7.5. Treated as an entire population, σ2=30/5=6\sigma^2 = 30 / 5 = 6. On small data sets the gap is far larger than a rounding difference, so the sample-or-population question has to be settled before the arithmetic starts.

Squaring is also what makes variance awkward to report. If those five numbers are minutes, the variance is 7.5 square minutes, a unit with no physical meaning. Taking the square root undoes that and returns the standard deviation, s=7.5=2.74s = \sqrt{7.5} = 2.74 minutes, which is why AP Statistics quotes ss in almost every context and keeps s2s^2 for the algebra underneath.

Two properties fall straight out of the definition. Variance is never negative, and it equals 0 exactly when every value is identical to the mean, since that is the only way for all the squared terms to vanish. And because the distances are squared before they are added, one far-out observation contributes out of all proportion to the rest, so variance is not resistant. When outliers are present the interquartile range is the spread measure to reach for, and the median rather than the mean is the matching center.

Variance appears directly in one of finance's standard measures. An asset's beta is the covariance of its returns with the market's, divided by the variance of the market's returns, so the denominator is exactly the quantity defined here: beta.

Full entry for variance

Where each one fits in the course