Skip to main content

Sum of squares

Sum of squares decomposes total variation in a dataset into an explained part (SSR) and an unexplained part (SSE); it is the building block behind R-squared, ANOVA and the F-test.

ByHoang TruongUpdated

See it move

Loading infographic...

Four months of advertising spend and sales give total sum of squares SST = 13.0. The fitted regression line explains SSR = 12.8 of that variation, leaving SSE = 0.2 unexplained — and 12.8 + 0.2 reproduces the 13.0 total exactly, since SST always equals SSR plus SSE.

Where it fits
SubjectData Analysis & StatisticsCoreTopicCommon Significance TestsCoreTopicSimple Linear Regression & OLSCore

The formula

LaTeX
SST=SSR+SSESST = SSR + SSE

Variables

Total sum of squares (squared units of y)
Regression (explained) sum of squares (squared units of y)
Error (unexplained) sum of squares (squared units of y)

The core decomposition: total variation in the outcome splits exactly into an explained part and an unexplained part.

LaTeX
SST=(yiyˉ)2,SSR=(y^iyˉ)2,SSE=(yiy^i)2SST=\sum (y_i-\bar y)^2,\quad SSR=\sum(\hat y_i - \bar y)^2,\quad SSE=\sum(y_i-\hat y_i)^2

Variables

Actual observed value
Fitted (predicted) value from the regression
Mean of the observed y values

Defines each sum of squares from the actual, fitted and mean values of the outcome variable.

Check yourself

PracticeCORE

A simple regression of exam score on study hours for four students produces SST = 725 and SSE = 5. What is SSR, and what does it represent?

Select an answer to check your understanding.
Sum of squares — Edlintics Glossary