In statistics, SSE stands for Sum of Squared Errors (also called the sum of squared residuals). It is the total of the squared differences between each observed value and the value predicted by a model. SSE is a core quantity in regression analysis and ANOVA, where it measures the unexplained variation left over after fitting a model. A smaller SSE means the model's predictions are closer to the actual data points, but SSE alone is not a complete measure of model quality because it depends on the number of observations and the scale of the data.
What SSE Measures
SSE quantifies the discrepancy between observed data and model predictions. For each data point, you take the observed value (y), subtract the predicted value (ŷ), square that difference, and add up all those squared terms. Squaring does two things: it makes all contributions positive (so over- and under-predictions don't cancel), and it penalizes large errors more heavily than small ones. The formula is:
SSE = Σ (yᵢ − ŷᵢ)²
where the sum runs over all n observations. In a simple linear regression with one predictor, ŷᵢ = b₀ + b₁xᵢ, where b₀ is the intercept and b₁ is the slope. SSE is the quantity that ordinary least squares (OLS) minimizes when estimating those coefficients. In ANOVA, SSE represents the within-group variation (also called residual or error sum of squares), while the between-group variation is captured by the sum of squares for the factor.
How SSE Is Used in Regression
SSE is the foundation of many regression diagnostics and model comparisons. It appears in the calculation of the residual standard error, R-squared, and the F-statistic. Here is how it fits into the bigger picture:
- Residual standard error (RSE): RSE = √(SSE / (n − p)), where p is the number of estimated parameters. RSE puts SSE back on the scale of the response variable, making it easier to interpret.
- R-squared (R²): R² = 1 − SSE / SST, where SST is the total sum of squares (the variation of y around its mean). R² is the proportion of total variation explained by the model.
- F-statistic for overall model significance: F = [(SST − SSE) / (p − 1)] / [SSE / (n − p)]. A large F indicates that the model explains more variation than would be expected by chance.
- Comparing nested models: The difference in SSE between a full model and a reduced model, divided by the difference in parameters, forms the numerator of an F-test for whether the additional terms improve fit.
Because SSE decreases as you add predictors (even irrelevant ones), it is not suitable on its own for choosing among models with different numbers of parameters. Adjusted R², AIC, BIC, or cross-validation are better tools for that purpose.
SSE vs. Other Sums of Squares
SSE is often confused with SST and SSR. The three are related by the decomposition SST = SSR + SSE in ordinary least squares with an intercept. Here is a quick comparison:
- SST (Total Sum of Squares): Σ (yᵢ − ȳ)², the total variation of the response around its mean.
- SSR (Regression Sum of Squares): Σ (ŷᵢ − ȳ)², the variation explained by the model. Some texts call this the model sum of squares.
- SSE (Error Sum of Squares): Σ (yᵢ − ŷᵢ)², the variation not explained by the model.
Note that terminology varies: some sources use SSR for the sum of squared residuals (what we call SSE here) and call the explained part SSM or SSReg. Always check the definitions in your textbook or software output. In R, for example, the anova() function reports "Residuals" for SSE, while Python's statsmodels reports "SSE" or "ssr" depending on the function.
Worked Example
Suppose you have five observations of a response y and a single predictor x, and you fit a simple linear regression. The observed and predicted values are:
- y = 2, ŷ = 1.8 → residual = 0.2, squared = 0.04
- y = 4, ŷ = 3.9 → residual = 0.1, squared = 0.01
- y = 5, ŷ = 5.2 → residual = −0.2, squared = 0.04
- y = 7, ŷ = 6.8 → residual = 0.2, squared = 0.04
- y = 9, ŷ = 9.3 → residual = −0.3, squared = 0.09
SSE = 0.04 + 0.01 + 0.04 + 0.04 + 0.09 = 0.22. The mean of y is 5.4, so SST = (2−5.4)² + (4−5.4)² + (5−5.4)² + (7−5.4)² + (9−5.4)² = 11.56 + 1.96 + 0.16 + 2.56 + 12.96 = 29.2. Then R² = 1 − 0.22/29.2 ≈ 0.9925, indicating the model explains about 99.25% of the variation. The residual standard error is √(0.22 / (5−2)) = √0.0733 ≈ 0.271.
Common Misconceptions and Pitfalls
SSE is frequently misunderstood in a few ways:
- SSE is not the same as the standard error of the estimate. The standard error (often denoted s or RSE) is √(SSE/(n−p)), which adjusts for degrees of freedom.
- A lower SSE does not always mean a better model. Adding parameters always reduces SSE, even if the new parameters are noise. Use adjusted measures or cross-validation.
- SSE is scale-dependent. If you change the units of y (e.g., from dollars to thousands of dollars), SSE changes by the square of the scaling factor. This makes SSE hard to compare across datasets with different scales.
- SSE is not robust to outliers. Because errors are squared, a single large outlier can dominate SSE and distort coefficient estimates in OLS.
Frequently Asked Questions
What does SSE stand for in statistics?
SSE stands for Sum of Squared Errors. It is also called the sum of squared residuals or the error sum of squares. It measures the total squared difference between observed values and model predictions.
Is SSE the same as standard error?
No. SSE is a sum of squared residuals, while standard error (often called residual standard error) is a measure of typical residual size, calculated as the square root of SSE divided by its degrees of freedom. Standard error is on the same scale as the response variable; SSE is on the squared scale.
How is SSE calculated?
For each observation, subtract the predicted value from the observed value, square the result, and add up all those squared differences. The formula is SSE = Σ (yᵢ − ŷᵢ)².
Can SSE be negative?
No. Because each term is squared, SSE is always zero or positive. It equals zero only when every prediction matches every observation exactly.
What is a good SSE value?
There is no universal threshold. SSE depends on the scale of the data and the number of observations. It is more useful to compare SSE across models fitted to the same data or to convert it into R² or residual standard error for interpretation.
Why do we square the errors in SSE?
Squaring makes all errors positive so they don't cancel, and it gives more weight to large errors. This is mathematically convenient and leads to the closed-form solutions of ordinary least squares.