|
|
Line 96: |
Line 96: |
|
:<math> TSS = ||y - \bar y||_2^2 = ||y - {\hat y} + {\hat y} - \bar y||_2^2 </math> |
|
:<math> TSS = ||y - \bar y||_2^2 = ||y - {\hat y} + {\hat y} - \bar y||_2^2 </math> |
|
:<math> TSS = ||y - {\hat y}||_2^2 + ||{\hat y} - \bar y||_2^2 + 2 <y - {\hat y}, {\hat y} - {\bar y}> </math> |
|
:<math> TSS = ||y - {\hat y}||_2^2 + ||{\hat y} - \bar y||_2^2 + 2 <y - {\hat y}, {\hat y} - {\bar y}> </math> |
|
:<math> TSS = RSS + ESS + 2 y^T {\hat y} -2 {\hat y}^T {\hat y} - 2 y^T {\bar y} + 2 {\hat y}{\bar y} </math> |
|
:<math> TSS = RSS + ESS + 2 y^T {\hat y} -2 {\hat y}^T {\hat y} - 2 y^T {\bar y} + 2 {\hat y}^T{\bar y} </math> |
|
:<math> TSS = RSS + ESS - 2 y^T {\bar y} + 2 {\hat y}{\bar y} </math> |
|
:<math> TSS = RSS + ESS - 2 y^T {\bar y} + 2 {\hat y}{\bar y} </math> |
|
which again gives the result that ''TSS'' = ''ESS'' + ''RSS'' if and only if <math>y^T \bar y = \hat y^T \bar y</math>. |
|
which again gives the result that ''TSS'' = ''ESS'' + ''RSS'' if and only if <math>y^T \bar y = \hat y^T \bar y</math>. |
In statistics, the explained sum of squares (ESS), alternatively known as the Model Sum of Squares or Sum of Squares due to Regression ("SSR" – not to be confused with the residual sum of squares when this writing is being used), is a quantity used in describing how well a model, often a regression model, represents the data being modelled. In particular, the explained sum of squares measures how much variation there is in the modelled values and this is compared to the total sum of squares, which measures how much variation there is in the observed data, and to the residual sum of squares, which measures the variation in the modelling errors.
Definition
The explained sum of squares (ESS) is the sum of the squares of the deviations of the predicted values from the mean value of a response variable, in a standard regression model — for example, yi = a + b1x1i + b2x2i + ... + εi, where yi is the i th observation of the response variable, xji is the i th observation of the j th explanatory variable, a and bi are coefficients, i indexes the observations from 1 to n, and εi is the i th value of the error term. In general, the greater the ESS, the better the estimated model performs.
If
and
are the estimated coefficients, then
![{\displaystyle {\hat {y}}_{i}={\hat {a}}+{\hat {b_{1}}}x_{1i}+{\hat {b_{2}}}x_{2i}+\cdots \,}](https://wikimedia.org/api/rest_v1/media/math/render/svg/c864b3991fddaf616828106544b2d6a370828770)
is the i th predicted value of the response variable. The ESS is the sum of the squares of the differences of the predicted values and the mean value of the response variable:
![{\displaystyle {\text{ESS}}=\sum _{i=1}^{n}\left({\hat {y}}_{i}-{\bar {y}}\right)^{2}.}](https://wikimedia.org/api/rest_v1/media/math/render/svg/97d89b80ceaa5808302275e61e55496360de0942)
In general: total sum of squares = explained sum of squares + residual sum of squares.
Partitioning in simple linear regression
The following equality, stating that the total sum of squares equals the residual sum of squares plus the explained sum of squares, is generally true in simple linear regression:
![{\displaystyle \sum _{i=1}^{n}\left(y_{i}-{\bar {y}}\right)^{2}=\sum _{i=1}^{n}\left(y_{i}-{\hat {y}}_{i}\right)^{2}+\sum _{i=1}^{n}\left({\hat {y}}_{i}-{\bar {y}}\right)^{2}.}](https://wikimedia.org/api/rest_v1/media/math/render/svg/543209a402ebc9d944f23d609ad93ecf271459cf)
Simple derivation
![{\displaystyle {\begin{aligned}(y_{i}-{\bar {y}})=(y_{i}-{\hat {y}}_{i})+({\hat {y}}_{i}-{\bar {y}}).\end{aligned}}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/9ee76c5348f418204f2d620a1ca3c3885e4f322f)
Square both sides and sum over all i:
![{\displaystyle \sum _{i=1}^{n}(y_{i}-{\bar {y}})^{2}=\sum _{i=1}^{n}(y_{i}-{\hat {y}}_{i})^{2}+\sum _{i=1}^{n}({\hat {y}}_{i}-{\bar {y}})^{2}+\sum _{i=1}^{n}2({\hat {y}}_{i}-{\bar {y}})(y_{i}-{\hat {y}}_{i}).}](https://wikimedia.org/api/rest_v1/media/math/render/svg/e84a0cf17457bf99ec121bbbbc078e9ae7e03886)
Simple linear regression gives
.[1] What follows depends on this.
![{\displaystyle {\begin{aligned}\sum _{i=1}^{n}2({\hat {y}}_{i}-{\bar {y}})(y_{i}-{\hat {y}}_{i})&=\sum _{i=1}^{n}2(({\bar {y}}-{\hat {b}}{\bar {x}}+{\hat {b}}x_{i})-{\bar {y}})(y_{i}-{\hat {y}}_{i})\\&=\sum _{i=1}^{n}2(({\bar {y}}+{\hat {b}}(x_{i}-{\bar {x}}))-{\bar {y}})(y_{i}-{\hat {y}}_{i})\\&=\sum _{i=1}^{n}2({\hat {b}}(x_{i}-{\bar {x}}))(y_{i}-{\hat {y}}_{i})\\&=\sum _{i=1}^{n}2{\hat {b}}(x_{i}-{\bar {x}})(y_{i}-({\bar {y}}+{\hat {b}}(x_{i}-{\bar {x}})))\\&=\sum _{i=1}^{n}2{\hat {b}}((y_{i}-{\bar {y}})(x_{i}-{\bar {x}})-{\hat {b}}(x_{i}-{\bar {x}})^{2}).\end{aligned}}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/64bdd0e8b0df238f0965604fa65d3d229ee7bde6)
Again simple linear regression gives[1]
![{\displaystyle {\hat {b}}=\left(\sum _{i=1}^{n}(x_{i}-{\bar {x}})(y_{i}-{\bar {y}})\right)/\left(\sum _{i=1}^{n}(x_{i}-{\bar {x}})^{2}\right),}](https://wikimedia.org/api/rest_v1/media/math/render/svg/5cfddedf94d6fe78520c13c725920c4c89c8c06e)
![{\displaystyle {\begin{aligned}\sum _{i=1}^{n}2({\hat {y}}_{i}-{\bar {y}})(y_{i}-{\hat {y}}_{i})&=\sum _{i=1}^{n}2{\hat {b}}\left((y_{i}-{\bar {y}})(x_{i}-{\bar {x}})-{\hat {b}}(x_{i}-{\bar {x}})^{2}\right)\\&=2{\hat {b}}\left(\sum _{i=1}^{n}(y_{i}-{\bar {y}})(x_{i}-{\bar {x}})-{\hat {b}}\sum _{i=1}^{n}(x_{i}-{\bar {x}})^{2}\right)\\&=2{\hat {b}}\sum _{i=1}^{n}\left((y_{i}-{\bar {y}})(x_{i}-{\bar {x}})-(y_{i}-{\bar {y}})(x_{i}-{\bar {x}})\right)\\&=2{\hat {b}}\cdot 0=0.\end{aligned}}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/fdfc078544488c04a660a2ef2ca2a24f373bd48b)
Partitioning in the general OLS model
The general regression model with n observations and k explanators, the first of which is a constant unit vector whose coefficient is the regression intercept, is
![{\displaystyle y=X\beta +e}](https://wikimedia.org/api/rest_v1/media/math/render/svg/78fe0b4da627e5c9f497fcd6edcee673d4350004)
where y is an n × 1 vector of dependent variable observations, each column of the n × k matrix X is a vector of observations on one of the k explanators,
is a k × 1 vector of true coefficients, and e is an n × 1 vector of the true underlying errors. The ordinary least squares estimator for
is
![{\displaystyle {\hat {\beta }}=(X^{T}X)^{-1}X^{T}y.}](https://wikimedia.org/api/rest_v1/media/math/render/svg/afeec101589661583a68428df4c624590c21735d)
The residual vector
is
, so the residual sum of squares
is, after simplification,
![{\displaystyle RSS=y^{T}y-y^{T}X(X^{T}X)^{-1}X^{T}y.}](https://wikimedia.org/api/rest_v1/media/math/render/svg/62cba2004de0216c144e88f6e7363621f9c4057e)
Denote as
the constant vector all of whose elements are the sample mean
of the dependent variable values in the vector y. Then the total sum of squares is
![{\displaystyle TSS=(y-{\bar {y}})^{T}(y-{\bar {y}})=y^{T}y-2y^{T}{\bar {y}}+{\bar {y}}^{T}{\bar {y}}.}](https://wikimedia.org/api/rest_v1/media/math/render/svg/8707163c7f83101b632fd8c89dd2818e8135b8ff)
The explained sum of squares, defined as the sum of squared deviations of the predicted values from the observed mean of y, is
![{\displaystyle ESS=({\hat {y}}-{\bar {y}})^{T}({\hat {y}}-{\bar {y}})={\hat {y}}^{T}{\hat {y}}-2{\hat {y}}^{T}{\bar {y}}+{\bar {y}}^{T}{\bar {y}}.}](https://wikimedia.org/api/rest_v1/media/math/render/svg/f28eb724a5ac9df4f1f3d3c08ba4d2ac3f210c01)
Using
in this, and simplifying to obtain
, gives the result that TSS = ESS + RSS if and only if
. The left side of this is
times the sum of the elements of y, and the right side is
times the sum of the elements of
, so the condition is that the sum of the elements of y equals the sum of the elements of
, or equivalently that the sum of the prediction errors (residuals)
is zero. This can be seen to be true by noting the well-known OLS property that the k × 1 vector
: since the first column of X is a vector of ones, the first element of this vector
is the sum of the residuals and is equal to zero. This proves that the condition holds for the result that TSS = ESS + RSS.
In linear algebra terms, we have
,
,
.
The proof can be simplified by noting that
. The proof is as follows:
![{\displaystyle {\hat {y}}^{T}{\hat {y}}=y^{T}X(X^{T}X)^{-1}X^{T}X(X^{T}X)^{-1}X^{T}y=y^{T}X(X^{T}X)^{-1}X^{T}y=y^{T}{\hat {y}},}](https://wikimedia.org/api/rest_v1/media/math/render/svg/e37ac5ab5d562b513d09afc4922aaabcf97b045e)
Thus,
![{\displaystyle TSS=||y-{\bar {y}}||_{2}^{2}=||y-{\hat {y}}+{\hat {y}}-{\bar {y}}||_{2}^{2}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/ec242053541a443362bbce9d027db26b15680446)
![{\displaystyle TSS=||y-{\hat {y}}||_{2}^{2}+||{\hat {y}}-{\bar {y}}||_{2}^{2}+2<y-{\hat {y}},{\hat {y}}-{\bar {y}}>}](https://wikimedia.org/api/rest_v1/media/math/render/svg/142dda496359b6c559197990709407499c100a2a)
![{\displaystyle TSS=RSS+ESS+2y^{T}{\hat {y}}-2{\hat {y}}^{T}{\hat {y}}-2y^{T}{\bar {y}}+2{\hat {y}}^{T}{\bar {y}}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/3c08fac2d5cb33b72e93b1b258115ba27739f741)
![{\displaystyle TSS=RSS+ESS-2y^{T}{\bar {y}}+2{\hat {y}}{\bar {y}}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/8e2d0664912f087db777aa260a63e7eac948c49e)
which again gives the result that TSS = ESS + RSS if and only if
.
See also
Notes
- ^ a b Mendenhall, William (2009). Introduction to Probability and Statistics (13th ed.). Belmont, CA: Brooks/Cole. p. 507. ISBN 9780495389538.
References
- S. E. Maxwell and H. D. Delaney (1990), "Designing experiments and analyzing data: A model comparison perspective". Wadsworth. pp. 289–290.
- G. A. Milliken and D. E. Johnson (1984), "Analysis of messy data", Vol. I: Designed experiments. Van Nostrand Reinhold. pp. 146–151.
- B. G. Tabachnick and L. S. Fidell (2007), "Experimental design using ANOVA". Duxbury. p. 220.
- B. G. Tabachnick and L. S. Fidell (2007), "Using multivariate statistics", 5th ed. Pearson Education. pp. 217–218.