I am running some linear regressions in R. I am dealing with a linear dependent and linear as well as categorical independent variables using lm. So far, I have looked at the output that
summary(model) gives me.
Calculates type-II or type-III analysis-of-variance tables for model objects.
I am under the impression that this
Anova() returns an F instead of the t-statistic but is ~ equivalent in what its tell me. (sample output below). So I was wondering
Are standard R
Anova(lm)indeed doing pretty much the same calculations here? If not, what is the difference?
They both report the same p-value, however the F-statistic at the bottom of the standard output is different from the
Anova()one. Why is that?
What are applications where one would choose one over the other?
Any help is much appreciated!
summary(linreg) ... Estimate t value Pr(>|t|) Age -18.016 -3.917 0.000107 Gender -45.4912 -4.916 1.35e-06 --- Residual standard error: 85.81 on 359 degrees of freedom F-statistic: 16.71 on 2 and 359 DF, p-value: 1.147e-07
Anova(linreg) Anova Table (Type II tests) Sum Sq F value Pr (>F) Age 112997 15.345 0.0001072 Gender 1777936 24.164 1.348e-06