Reputation: 35
I have fit a simple multiple linear regression model in R and printed the ANOVA output which looks like this:
Is there a way to get the output to match the MINITAB ANOVA output:
Upvotes: 1
Views: 242
Reputation: 1277
I did not find anything about the default type of the ANOVA used in MINITAB, but most likely it is type III. R's anova
does type I ANOVA, however. When you have no "interaction terms", you can achieve a type III ANOVA in R with drop1(..., test="F")
.
Explanation: type I ANOVA adds predictors one by one and tests the effect of their addition to the F statistic. Obviously, the result depends on the order in which the variables are added, i.e., anova(lm(y~x1+x2, data))
leads to different p-values than anova(lm(y~x2+x1, data))
. To avoid this problem, type III ANOVA tests the effect on the F statistic with just one variable omitted.
Each ANOVA variant has its issues. Type I ANOVA can assign "statistical significance" to a variable or not depending on the position in the formula. Type III ANOVA, OTOH, can identify all predictors as "statistically insignificant" even for a good predictive model, e.g. in cases of (multi-)collinear variables.
Upvotes: 1