The sum of squares (SS) is the raw material of almost every measure of spread and every least-squares method. It adds up how far each value lies from the mean, after squaring so that values below and above the mean do not cancel. Divide it by n − 1 and you have the sample variance; take a square root and you have the standard deviation.
In regression and analysis of variance the total sum of squares is split into parts: the part explained by the model (regression or between-group SS) and the part left over (residual or within-group SS). Comparing those parts gives R² and the F statistic. That is why statistical output is full of SS columns.
Do not confuse SS with the plain “sum of squared values” Σx², which adds the squares of the numbers themselves without subtracting the mean. Both are shown here, because the shortcut formula SS = Σx² − (Σx)² ÷ n links them – handy on a calculator, though it can lose precision with very large numbers.
How to use the Sum of Squares Calculator
- Data
Everything is calculated in your browser, so results appear instantly and nothing you type is sent to a server.
How it works
Enter your numbers. The calculator finds the mean, subtracts it from every value, squares each deviation and adds them. It also reports Σx² and the variance and standard deviation that follow from SS.
Worked example
For 6, 9, 11, 14 and 15 the sum is 55 and the mean 11. The deviations −5, −2, 0, 3 and 4 square to 25, 4, 0, 9 and 16, so SS = 54. The shortcut gives the same: Σx² = 36 + 81 + 121 + 196 + 225 = 659, and 659 − 55² ÷ 5 = 54. The sample variance is 54 ÷ 4 = 13.5 and the standard deviation √13.5 = 3.674.
Where sums of squares appear
| Method | Sum of squares used | What it gives |
|---|---|---|
| Variance | SS of one variable | s² = SS ÷ (n − 1) |
| Regression | SST = SSR + SSE | R² = SSR ÷ SST |
| One-way ANOVA | SS between + SS within | F = MS between ÷ MS within |
| Model error | SSE | MSE = SSE ÷ n |
Formula
SS = Σ(xᵢ − x̄)² = Σxᵢ² − (Σxᵢ)² ÷ n · sample variance = SS ÷ (n − 1) · population variance = SS ÷ n
Worked example
Inputs — Data: 6, 9, 11, 14, 15.
Results — Sum of squares Σ(x − x̄)² = 54; Sum of squared values Σx² = 659; Sum Σx = 55; Mean x̄ = 11; Number of values = 5; Sample variance SS ÷ (n − 1) = 13.5.
Key terms
- Sum of squares (SS)
- Σ(x − x̄)², the total squared deviation from the mean.
- Deviation
- A value minus the mean.
- Partition of the sum of squares
- Splitting the total SS into explained and unexplained parts in regression or ANOVA.
Frequently asked questions
How do I calculate the sum of squares?
Find the mean, subtract it from each value, square the results and add them. For 20, 22 and 18 the mean is 20 and SS = 0 + 4 + 4 = 8.
What is the shortcut formula?
SS = Σx² − (Σx)² ÷ n. For 6, 9, 11, 14, 15: 659 − 55² ÷ 5 = 659 − 605 = 54.
What is the difference between the sum of squares and the standard deviation?
SS is a total in squared units that grows with every value; the standard deviation √(SS ÷ (n − 1)) is an average spread in the original units.
What are SST, SSR and SSE?
In regression, the total sum of squares (SST) splits into the regression sum of squares (SSR, explained) and the error sum of squares (SSE, unexplained): SST = SSR + SSE, and R² = SSR ÷ SST.
Can the sum of squares be negative or zero?
Never negative. It is zero only when every value equals the mean.
Is the sum of squares the same as Σx²?
No. Σx² adds the squared values themselves; the sum of squares subtracts the mean first. They are equal only when the mean is 0.