I'm teaching Multiple Regression again this semester, so I'm once again reminded that the ANOVA output from R is not the same as from other statistical software. A quick google turned up this post from r-help which has essentially my exact question, so I'll quote from it here (data changed for better reproducibility):
I am trying to figure out how to get an ANOVA table that shows the sum of squares. degrees of freedom, etc, for the full model versus the error (aka residuals).
Here is an example of the kind of table I'd like to get:
Analysis of Variance Source DF SS MS F P Regression 2 0.9715 0.485728 52.13 0.000 Error 29 0.2702 0.009318 Total 31 1.2417
This kind of table is prevalent throughout my statistics textbook, and can apparently be easily obtained in other statistical software tools. I'm not saying this as a gripe, but just as evidence that I'm not trying to do something obviously bizarre.
Here is an example of the only kind of ANOVA table for a single linear model that I've been able to get using R:
library(Stat2Data) data("NFLStandings2016") m1 = lm(WinPct ~ PointsFor + PointsAgainst, data = NFLStandings2016) anova(m1) #> Analysis of Variance Table #> #> Response: WinPct #> Df Sum Sq Mean Sq F value Pr(>F) #> PointsFor 1 0.41262 0.41262 44.280 2.692e-07 *** #> PointsAgainst 1 0.55884 0.55884 59.972 1.537e-08 *** #> Residuals 29 0.27023 0.00932 #> --- #> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Created on 2019-10-11 by the reprex package (v0.2.1)
Is there a way to get an ANOVA table with the full linear regression model considered as a whole rather than broken down into each additional predictor variable? In other words, is there a way to get the former kind of table?
The response on r-help includes quotes like "the logical thing to do would be" and also "if you really want the column of MS, you have a little extra work to do." Is there really no command in R that produces this kind of summary table? My guess is it's hiding in some modeling package and I haven't stumbled across it, but I also wouldn't be surprised if there was some base print method I'm missing.