ranova

When performing anova analysis of a multiple regression model in R studio, how is the sum of square value of each explanatory variable calculated?


[enter image description here](https://i.sstatic.net/2DG3z.png)

I think it should be (SSE of reduced model - SSE of full model). If so, is the reduced model a model in which only each variable is removed? If not, how is it calculated? Please explain using the Agr variable as an example.

[enter image description here](https://i.sstatic.net/W4X8z.png)

The SSE of the model with Agr removed was 0.5504. 0.5504 - 0.5188 = 0.0316, which is not 0.5590


Solution

  • The anova function in R performs a Type 1 ANOVA. If you used car::Anova(..,type=2) it could perform a Type 2 ANOVA which would behave as you expect.

    So in your case, because Agr is the first term entered, the sum of squares for Agr reported by anova is the difference in the SSE between the null model Nitrogen~1 and the model with Agr alone as a predictor.

    See here for more explanation https://www.r-bloggers.com/2011/03/anova-%E2%80%93-type-iiiiii-ss-explained/