Partitioning Sums of Squares
This section discusses the sums of squares, including partitioning sum of squares into sums of squares predicted and sum of squares error.
Partitioning the Sums of Squares
Learning Objectives
 Compute the sum of squares
 Convert raw scores to deviation scores
 Compute predicted scores from a regression equation
 Partition sum of squares into sum of squares predicted and sum of squares error
 Define in terms of sum of squares explained and sum of squares
One useful aspect of regression is that it can divide the variation in into two parts: the variation of the predicted scores and the variation of the errors of prediction. The variation of is called the sum of squares and is defined as the sum of the squared deviations of from the mean of . In the population, the formula is
where is the sum of squares , is an individual value of , and is the mean of . A simple example is given in Table 1. The mean of is 2.06 and is the sum of the values in the third column and is equal to 4.597.
When computed in a sample, ou should use the sample mean, , in place of the population mean:
It is sometimes convenient to use formulas that
use deviation
scores rather than raw
scores. Deviation scores are simply deviations from the mean.
By convention, small letters rather than capitals are used for
deviation scores. Therefore the score indicates the difference
between and the mean of . Table 2 shows the use of this notation.
The numbers are the same as in Table 1.
Table 2. Example of using Deviation Scores.



1.00  1.06  1.1236 
2.00  0.06  0.0036 
1.30  0.76  0.5776 
3.75  1.69  2.8561 
2.25  0.19  0.0361 
The data in Table 3 are reproduced from the introductory
section. The column has the values of the predictor
variable and the column has the criterion
variable. The third column, , contains the differences
between the column and the mean of .
Table 3. Example data. The last row contains column sums.
The fourth column, , is simply the square
of the column. The column ' contains the predicted values of
. In the introductory section, it was shown that the equation for
the regression line for these data is
The values of ' were computed according to this equation. The column ' contains deviations of from the mean of and is the square of this column. The nexttolast column, , contains the actual scores (Y) minus the predicted scores (Y'). The last column contains the squares of these errors of prediction.
We are now in a position to see how the is partitioned. Recall that is the sum of the squared deviations from the mean. It is therefore the sum of the column and is equal to 4.597. can be partitioned into two parts: the sum of squares predicted () and the sum of squares error (). The sum of squares predicted is the sum of the squared deviations of the predicted scores from the mean predicted score. In other words, it is the sum of the column and is equal to 1.806. The sum of squares error is the sum of the squared errors of prediction. It is therefore the sum of the column and is equal to 2.791. This can be summed up as:
There are several other notable features about Table 3. First, notice that the sum of and the sum of are both zero. This will always be the case because these variables were created by subtracting their respective means from each value. Also, notice that the mean of is 0. This indicates that although some values are higher than their respective predicted values and some are lower, the average difference is zero.
The SSY is the total variation, the SSY' is the variation explained, and the SSE is the variation unexplained. Therefore, the proportion of variation explained can be computed as:
Similarly, the proportion not explained is:
There is an important relationship between the proportion of variation explained and Pearson's correlation: is the proportion of variation explained. Therefore, if , then, naturally, the proportion of variation explained is 1; if , then the proportion explained is 0. One last example: for , the proportion of variation explained is 0.16.
Since the variance is computed by dividing the variation by (for a population) or (for a sample), the relationships spelled out above in terms of variation also hold for variance. For example,
where the first term is the variance total, the second term is the variance of , and the last term is the variance of the errors of prediction . Similarly, is the proportion of variance explained as well as the proportion of variation explained].
Summary Table
It is often convenient to summarize the partitioning of the data in a table. The degrees
of freedom column () shows the degrees of freedom for each
source of variation. The degrees of freedom for the sum of squares
explained is equal to the number of predictor variables. This will
always be 1 in simple regression. The error degrees of freedom is equal
to the total number of observations minus 2. In this example, it is 5  2
= 3. The total degrees of freedom is the total number of observations
minus 1.
Table 4. Summary Table for Example Data.
Source  Sum of Squares  Mean Square  

Explained  1.806  1  1.806 
Error  2.791  3  0.930 
Total  4.597  4 
Source: David M. Lane , https://onlinestatbook.com/2/regression/partitioning.html
This work is in the Public Domain.