The partition of sums of squares is a concept that permeates much of inferential statistics and descriptive statistics. More properly, it is the partitioning of sums of squared deviations or errors. Mathematically, the sum of squared deviations is an unscaled, or unadjusted measure of dispersion (also called variability). When scaled for the number of degrees of freedom, it estimates the variance, or spread of the observations about their mean value. Partitioning of the sum of squared deviations into various components allows the overall variability in a dataset to be ascribed to different types or sources of variability, with the relative importance of each being quantified by the size of each component of the overall sum of squares.
The distance from any point in a collection of data, to the mean of the data, is the deviation. This can be written as
yi-\overline{y}
yi
\overline{y}
When more data are added to the collection the sum of squares will increase, except in unlikely cases such as the new data being equal to the mean. So usually, the sum of squares will grow with the size of the data collection. That is a manifestation of the fact that it is unscaled.
In many cases, the number of degrees of freedom is simply the number of data points in the collection, minus one. We write this as n - 1, where n is the number of data points.
Scaling (also known as normalizing) means adjusting the sum of squares so that it does not grow as the size of the data collection grows. This is important when we want to compare samples of different sizes, such as a sample of 100 people compared to a sample of 20 people. If the sum of squares were not normalized, its value would always be larger for the sample of 100 people than for the sample of 20 people. To scale the sum of squares, we divide it by the degrees of freedom, i.e., calculate the sum of squares per degree of freedom, or variance. Standard deviation, in turn, is the square root of the variance.
The above describes how the sum of squares is used in descriptive statistics; see the article on total sum of squares for an application of this broad principle to inferential statistics.
yi=\beta0+\beta1xi1+ … +\betapxip+\varepsiloni
\beta0
(yi,xi1,\ldots,xip),i=1,\ldots,n
TSS=
n | |
\sum | |
i=1 |
(yi-\bar{y})2
TSS=ESS+RSS,
\begin{align} \left\|y-\bar{y}1\right\|2&=\left\|\hat{y}-\bar{y}1\right\|2+\left\|\hat{\varepsilon}\right\|2, 1=(1,1,\ldots,1)T
n | |
,\\ \sum | |
i=1 |
(yi-\bar{y})2&=
n | |
\sum | |
i=1 |
(\hat{y}i-\bar{y})2+
n | |
\sum | |
i=1 |
(yi-
2 | |
\hat{y} | |
i) |
n | |
,\\ \sum | |
i=1 |
(yi-\bar{y})2&=
n | |
\sum | |
i=1 |
(\hat{y}i-\bar{y})2+
n | |
\sum | |
i=1 |
2 | |
\hat{\varepsilon} | |
i |
,\\ \end{align}
where
\hat{y}i
\hat{b}0
\hat{b}1
\hat{b}p
n | |
\begin{align} \sum | |
i=1 |
(yi-\overline{y})2&=
n | |
\sum | |
i=1 |
(yi-\overline{y}+\hat{y}i-
2 = | |
\hat{y} | |
i) |
n | |
\sum | |
i=1 |
((\hat{y}i-\bar{y})+\underbrace{(yi-\hat{y}i)}\hat{\varepsilon
2 | |
i}) |
\\ &=
n | |
\sum | |
i=1 |
((\hat{y}i-\bar{y})2+2\hat{\varepsilon}i(\hat{y}i-\bar{y})+
2) | |
\hat{\varepsilon} | |
i |
\\ &=
n | |
\sum | |
i=1 |
(\hat{y}i-\bar{y})2+
n | |
\sum | |
i=1 |
2 | |
\hat{\varepsilon} | |
i |
+2
n | |
\sum | |
i=1 |
\hat{\varepsilon}i(\hat{y}i-\bar{y})\\ &=
n | |
\sum | |
i=1 |
(\hat{y}i-\bar{y})2+
n | |
\sum | |
i=1 |
2 | |
\hat{\varepsilon} | |
i |
+2
n | |
\sum | |
i=1 |
\hat{\varepsilon}i(\hat{\beta}0+\hat{\beta}1xi1+ … +\hat{\beta}pxip-\overline{y})\\ &=
n | |
\sum | |
i=1 |
(\hat{y}i-\bar{y})2+
n | |
\sum | |
i=1 |
2 | |
\hat{\varepsilon} | |
i |
+2(\hat{\beta}0-\overline{y})
n | |
\underbrace{\sum | |
i=1 |
\hat{\varepsilon}i}0+2\hat{\beta}1
n | |
\underbrace{\sum | |
i=1 |
\hat{\varepsilon}ixi1
The requirement that the model include a constant or equivalently that the design matrix contain a column of ones ensures that
n | |
\sum | |
i=1 |
\hat{\varepsilon}i=0
\hat{\varepsilon}T1=0
The proof can also be expressed in vector form, as follows:
\begin{align} SStotal=\Verty-\bar{y}1\Vert2&=\Verty-\bar{y}1+\haty-\haty\Vert2,\\ &=\Vert\left(\haty-\bar{y}1\right)+\left(y-\haty\right)\Vert2,\\ &=\Vert{\haty-\bar{y}1
The elimination of terms in the last line, used the fact that
\hat\varepsilonTX=\left(y-\haty\right)TX=yT(I-X(XTX)-1XT)TX={y
Note that the residual sum of squares can be further partitioned as the lack-of-fit sum of squares plus the sum of squares due to pure error.
Republished as: Book: Prediction and Regulation by Linear Least-Square Methods. Whittle, P.. University of Minnesota Press. 1983. 0-8166-1148-3.