I am fitting a linear model in R
with three variables like so
cube_mod <- lm(y ~ x + x_2 + x_3)
I then use the anova
function to display the results of analysis of variance with and get the following table
anova(cube_mod)
Analysis of Variance Table
Response: y
Df Sum Sq Mean Sq F value Pr(>F)
x 1 21 21 0.0083 0.928881
x_2 1 658209 658209 254.2771 2.26e-10 ***
x_3 1 64967 64967 25.0977 0.000191 ***
Residuals 14 36240 2589
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
The table shows the F-test for each variable separately, but I want the following table which shows only the F-test for the full model.
Analysis of Variance Table
Response: y
Df Sum Sq Mean Sq F value Pr(>F)
Model 3 723197 241066 93.13 0
Residuals 14 36240 2589
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Is there a simple way to get this table from a linear model object?
summary(cube_mode)
and you will have all the values you want to create the table. – RodriguesAnova
function from thecar
package :car::Anova(cube_mod)
– Lynxeyed