Anova: $$ \mathit{SS}\_\text{total} = \mathit{SS}\_\text{between} + \mathit{SS}_\text{within} $$ LinReg: $$ \mathit{SS}\_\text{total} = \mathit{SS}\_\text{regression} + \mathit{SS}_\text{residual} $$ The last could be seen as: $$ \mathit{TSS} = \mathit{ESS} + \mathit{RSS} $$ And what are TSS, RSS, ESS? Here they are: $$ \mathit{TSS} =\sum_{j=1}^n (y_j - \bar y)^2 $$ $$ \mathit{ESS} = \sum_{j=1}^n (\hat y - \bar y)^2 $$ $$ \mathit{RSS} = \sum_{j=1}^n (y_j - \hat y)^2 $$ $$ \mathit{TSS} = \mathit{ESS} + \mathit{RSS} $$ $$ \mathit{R}^2 = \frac{\mathit{ESS}}{\mathit{TSS}} $$