Calculate sum of squares
Enter numbers separated by commas, spaces, or semicolons.
About the sum of squares
The sum of squares is a foundational quantity in statistics, algebra, regression, and experimental analysis. The phrase can refer to two related calculations, so this calculator reports both. The raw sum of squares is found by squaring every observation and adding those squares: Σx². The corrected sum of squares measures variation around the mean and is found with Σ(x − x̄)². Seeing both values prevents ambiguity and makes the result useful in a wider range of problems.
The raw sum of squares describes the squared magnitude of values relative to zero. For 1, 2, 3, and 4, it is 1² + 2² + 3² + 4² = 30. Negative observations contribute positive squares, which is why the raw sum for −2, 0, and 2 is 8. This form appears in vector lengths, least-squares algebra, signal energy, and intermediate statistical formulas. It changes if the entire data set is shifted by adding a constant.
The corrected sum of squares, sometimes called the total sum of squares, instead measures how far observations lie from their arithmetic mean. For 1, 2, 3, and 4, the mean is 2.5 and the squared deviations add to 5. Because every value is compared with the center, adding the same constant to all observations does not change this result. A corrected sum of zero means every observation is identical. Larger values indicate more total spread, although the value also tends to grow with sample size.
Sample variance follows directly from the corrected sum of squares. Divide it by n − 1, where n is the number of observations. The n − 1 denominator is Bessel's correction and is used when the entered observations are a sample from a larger population. If the values constitute the entire population, divide the corrected sum by n instead. The calculator displays sample variance when at least two observations are present because one value provides no degrees of freedom for estimating sample variation.
In analysis of variance and regression, sums of squares are partitioned into explained and unexplained components. Total variation may be separated into variation attributed to a model and residual error. Those calculations use the same central idea: square deviations so positive and negative differences cannot cancel, then add them. Squaring also places greater weight on large deviations, which is important when interpreting outliers.
Enter unrounded source observations whenever possible. Premature rounding of the mean or individual deviations can noticeably alter the final sum, especially in large data sets. This calculator keeps full numeric precision during computation and rounds only the displayed values. It therefore provides a fast check for homework, descriptive statistics, variance calculations, and the building blocks of regression or ANOVA.
Sum of squares FAQ
What is the formula for the raw sum of squares?
Square each observation and add the results, written Σx². This measures squared magnitude relative to zero rather than variation around the mean.
What is the corrected sum of squares?
It is the sum of squared differences between each observation and the mean, Σ(x − x̄)². It is also called the total sum of squares in many statistical contexts.
How is sample variance related to sum of squares?
Sample variance equals the corrected sum of squares divided by n − 1. The denominator corrects bias when a sample estimates population variance.
Can the sum of squares be negative?
No, every squared term is non-negative, so their sum cannot be negative. A corrected sum of zero occurs only when all observations are equal.
Why do ANOVA and regression use sums of squares?
Squared deviations quantify variation without positive and negative errors canceling. They can also be partitioned into model and residual components for comparison.