# Is equation for total sum of squares always valid?

I wanted to do simple calculations for sum of squares for linear regression using a very simple example.

1) Let's assume that we have 3 obervations [x,y]: [[1,1], [2,2], [3,3]].

2) I created simple regression model which for each x is assigning 3. So it is a flat line.

3) For that regression line I wanted to calculate: total sum of suares (TSS), residual sum of squares (RSS) and explained sum of squares (ESS).

As far as I know, TSS = RSS + ESS and here we have:

2 = 5 + 3


I can't figure out what I did wrong or TSS = RSS + ESS is aplicable only under certain conditions?