Measure of fit

Summary

Setup

  • Given an OLS trendline with intercept

\[y=b_1+b_2x\]

  • where \(b_1,b_2\) are determined by the OLS formula and \(e_i, {\hat{y}}_i\) are the OLS residuals and the OLS fitted values

TSS, ESS, RSS

  • Total sum of squares (TSS)

\[TSS=\sum_{i=1}^{n}{ {\left( y_i-\bar{y} \right)}^2 }\]

  • Explained sum of squares (ESS)

\[ESS=\sum_{i=1}^{n}{ {\left( {\hat{y}}_i-\bar{y} \right)}^2 }\]

  • Residual sum of squares ( RSS ) (as before)

\[RSS=\sum_{i=1}^{n}{ e_i^2 }\]

  • Note:
    • Sample variance in \(y\) -data is equal to \(TSS/(n-1)\)
    • Sample variance in   \(\hat{y}\) -data is equal to \(ESS/(n-1)\)
    • Sample variance in \(e\) -data is equal to \(RSS/(n-1)\)

Coefficient of determination

  • Result: \(TSS=ESS+RSS\)
  • Coefficient of determination

\[R^2= \frac{ESS}{TSS}=1- \frac{RSS}{TSS}\]

  • Result: \(0≤R^2≤1\)