# Partition of sums of squares (ANOVA)

Can anyone explain the theory (or the formula) about computing Sum Sq (bold highligh below) related to regression items? The Wikipedia link gives an introduction on how to calculate the total, model, and regression sum of squares. Is it similar to the Sum Sq computation? Is the regression sum of squares equal to (0.000437+ 0.002545+ 0.060984+ 0.062330+ 0.060480)?

TraingData <- data.frame(x1 = c(3.532,2.868,2.868,3.532,2.868,2.536,3.864),
x2 = c(1.992,1.992,1.328,1.328,1.328,1.66,1.66),
y  = c(9.040330254,8.900894412,8.701929163,9.057944749,
8.701929163,8.74317832,9.10859913)
)
lm.sol <- lm(y~1+x1+x2+I(x1^2)+I(x2^2)+I(x1*x2), data=TraingData)
anova(lm.sol)

Analysis of Variance Table

Response: y
Df   **Sum Sq**     Mean       Sq F    value Pr(>F)
x1          1   0.000437  0.000437    0.1055    0.8001
x2          1   0.002545  0.002545    0.6141    0.5768
I(x1^2)     1   0.060984  0.060984   14.7162    0.1623
I(x2^2)     1   0.062330  0.062330   15.0409    0.1607
I(x1 * x2)  1   0.060480  0.060480   14.5945    0.1630
Residuals   1   0.004144  0.004144

• I left out I(x1*x2). Then, apparently, the design matrix does not have full column rank. That is, there is some linear combination of the columns $x_1$, $x_2$, $x_1^2$ and $x_2^2$ that results in the intercept column $I=(1,1,1,1,1,1,1)$. For that reason, the coefficient of the last regressor you add to the model cannot be estimated. The rank is 4 while it should be 5 (i.e. number of regressors in the model). Interesting situation, though. Adding also regressor $x_1\cdot x_2$ yields a design matrix of rank 5 instead of 6, so also deficient. – StijnDeVuyst Jun 1 '19 at 19:39
• ... which is an explanation for why I got the same result as Gottfried Helms, not the one shown by the OP. – StijnDeVuyst Jun 1 '19 at 19:56

Response: y