# Anova Decomposition

source SS DF MS
error ESS n-2 ${\displaystyle s^{2}={{ESS} \over {n-2}}}$
total TSS n-1 -
• SS= Sum of squares
• DF= Degrees of freedom
• MS= Mean square

${\displaystyle TSS=RSS+ESS}$

${\displaystyle TSS=\sum _{i=1}^{n}(y_{i}-{\bar {y}})^{2}}$

${\displaystyle RSS={b_{2}}^{2}\sum _{i=1}^{n}(x_{i}-{\bar {x}})^{2}}$

${\displaystyle ESS=\sum _{i=1}^{n}(y_{i}-b_{1}-b_{2}x_{i})^{2}}$

##### Goodness of fit:

Goodness of fit ${\displaystyle R^{2}}$:

${\displaystyle R^{2}={{RSS} \over {TSS}}}$

Goodness of fit F-statistic:

${\displaystyle F={{RSS} \over {s^{2}}}}$

##### t-test:

${\displaystyle {t_{obs}}={{b_{2}} \over {s_{B_{2}}}}}$

${\displaystyle pvalue=2P_{H_{0}}(T\geq {|t_{obs}|})}$

##### Anova-test:

${\displaystyle {f_{obs}}={{RSS} \over {s^{2}}}}$

${\displaystyle pvalue=P_{H_{0}}(F\geq {f_{obs}})}$

##### Confidence intervals:

${\displaystyle \beta _{1}{:}b_{1}\pm {t}_{{1+\gamma } \over {2}}(n-2)s_{B_{1}}}$

${\displaystyle \beta _{2}{:}b_{2}\pm {t}_{{1+\gamma } \over {2}}(n-2)s_{B_{2}}}$

##### Residuals:

${\displaystyle TSS=\sum _{i=1}^{N}(y_{i}-{\bar {y}})^{2}=\sum _{i=1}^{n}({\hat {y}}_{i}-{\bar {y}})^{2}+\sum _{i=1}^{n}(y_{i}-{\hat {y}}_{i})^{2}}$

${\displaystyle RSS=\sum _{i=1}^{n}({\hat {y}}_{i}-{\bar {y}})^{2}}$

${\displaystyle ESS=\sum _{i=1}^{n}(y_{i}-{\hat {y}}_{i})^{2}}$

##### Forecast:

${\displaystyle x=x^{*}}$

${\displaystyle {\hat {y}}=b_{1}+b_{2}x^{*}}$

${\displaystyle var(B_{1}+B_{2}x^{*})=\sigma ^{2}[{{1} \over {n}}+{{(x^{*}-{\bar {y}})^{2}} \over {\sum _{i=1}^{n}(x_{i}-{\bar {x}})^{2}}}]}$

${\displaystyle standarderror=s{\sqrt {{{1} \over {n}}+{{(x^{*}-{\bar {x}})^{2}} \over {\sum _{i=1}^{n}(x_{i}-{\bar {x}})^{2}}}}}}$