Measure of fit

Summary

Setup

  • Given an OLS trendline with intercept

y=b1+b2xy=b1+b2x

  • where b1,b2b1,b2 are determined by the OLS formula and ei,ˆyiei,^yi are the OLS residuals and the OLS fitted values

TSS, ESS, RSS

  • Total sum of squares (TSS)

TSS=ni=1(yiˉy)2TSS=ni=1(yi¯y)2

  • Explained sum of squares (ESS)

ESS=ni=1(ˆyiˉy)2ESS=ni=1(^yi¯y)2

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

RSS=ni=1e2iRSS=ni=1e2i

  • Note:
    • Sample variance in yy -data is equal to TSS/(n1)TSS/(n1)
    • Sample variance in   ˆy^y -data is equal to ESS/(n1)ESS/(n1)
    • Sample variance in ee -data is equal to RSS/(n1)RSS/(n1)

Coefficient of determination

  • Result: TSS=ESS+RSSTSS=ESS+RSS
  • Coefficient of determination

R2=ESSTSS=1RSSTSSR2=ESSTSS=1RSSTSS

  • Result: 0R210R21