Overview

The sum of squares adds up the squared distance of each value from the mean. It is the building block of variance, standard deviation, regression and ANOVA.

Enter your numbers. You also get the raw sum of squares, the mean and the sample variance.

Worked examples

InputsResult
Your numbers12, 16, 14, 21, 19Sum of squares (about the mean): 53.2Raw sum of squares (Σx²): 1,398Mean: 16.4Sample variance: 13.3
Show 2 more examples
Your numbers1, 2, 3, 4, 5Sum of squares (about the mean): 10Raw sum of squares (Σx²): 55Mean: 3Sample variance: 2.5
Your numbers2, 4, 4, 4, 5, 5, 7, 9Sum of squares (about the mean): 32Raw sum of squares (Σx²): 232Mean: 5Sample variance: 4.5714

How it works

Subtract the mean from each value, square the differences and add them. Dividing by n − 1 gives the sample variance. The raw sum of squares simply adds the squared values, without subtracting the mean, and the two are linked: SS = Σx² − n × mean².

The formula

SS = Σ(x − mean)²
xEach value

Practical tips

  • 12, 14, 16, 19 and 21 have a sum of squares of 53.2 and a sample variance of 13.3.
  • Squaring stops positive and negative distances from cancelling out.
  • In Excel, =DEVSQ(range) gives the sum of squares about the mean.

Frequently asked questions

What is the total sum of squares in regression?

The same calculation applied to the y values. It splits into explained and residual parts.

Why not use absolute distances?

Squares are mathematically convenient and lead to the variance. Absolute distances give the mean absolute deviation.