How do I extract Sum of Squares 283.5 from Anova output? It is not a$SumSq[3]
data(mtcars)
df <- data.frame(mtcars)
formula <- mpg~disp + hp
model <- lm(formula, data=df)
anova <- aov(formula, data=df)
a <- summary(anova)
str(a)
List of 1
:Classes ‘anova’ and 'data.frame': 3 obs. of 5 variables:
.. Df : num [1:3] 1 1 29
.. Sum Sq : num [1:3] 808.9 33.7 283.5
.. Mean Sq: num [1:3] 808.89 33.67 9.78
.. F value: num [1:3] 82.75 3.44 NA
.. Pr(>F) : num [1:3] 5.41e-10 7.37e-02 NA
- attr(*, "class")= chr [1:2] "summary.aov" "listof"