# Different versions of the ANOVA decomposition parameters

I'm trying to study some statistics online and I have difficulties figuring out why I keep encountering slightly different formulas for the parameters of the ANOVA decomposition : $$SCT = SCE + SCR$$

The most common versions of the SCT, SCE, and SCR I met in my courses are the following ones :

$$SCT = \sum_{i=1}^{n}(y_i-\bar{y})^2 \\ SCE = \sum_{i=1}^{n}(\hat{y_i}-\bar{y})^2 \\ SCR = \sum_{i=1}^{n}(y_i-\hat{y_i})^2$$

But in some other courses, I met these versions:

$$SCT = \sum_{i=1}^{k}\sum_{j=1}^{n_i}(y_{ij}-\bar{y})^2 \\ SCE = \sum_{i=1}^{k} n_i (\bar{y_i}-\bar{y})^2 \\ SCR = \sum_{i=1}^{k}\sum_{j=1}^{n_i}(y_{ij}-\bar{y_i})^2$$

To me, it seems to be the same formulas, and that bothers me because I'm pretty sure I'm missing something...

So, can you tell me if there is a difference, and if this is the case, when I'm supposed to use each version? Thank you!

P.S.: I made some tests with a small dataset filled with one qualitative and one quantitative, but I found the same results with both SCT formulas... I don't really understand why the number of classes k in the quantitative variable seems to be important.

• You quote formulas for two different applications: one-way and two-way ANOVA. At a deeper level they are the same formulas, because they express the decomposition of a quadratic form into orthogonal components. It is clear in any case which one (if either) is applicable: look at the numbers of subscripts you need!
– whuber
Commented Aug 13, 2021 at 22:43
• Thank you, that helps a lot! Commented Aug 13, 2021 at 23:27
• Why does the first formula have SCT on both sides? Commented Aug 14, 2021 at 0:05
• It was a typo. Sorry for that. Commented Aug 14, 2021 at 0:10