anova() for model comparision _ Regression let's suppose; I am fitting some models to a data set:
m1=lm(y~x1,data=data); m2=lm(y~x1+x2,data=data)
m3=lm(y~x1+x3, data=data); m4=lm(y~x2+x3, data=data)
m5=lm(y~x1+x2+x3, data=data)

I want to understand the use of anova() to compare different models.
My questions are:


*

*As discussed model compare by anova test, I need to put more general model later. So is anova(m2, m1) a wrong way of doing comparision?

*anova() can be used for nested models (models have a shared set of predictor variables and the same outcome variable, but one model has one or more additional predictor variables), can we use anova(m2, m3) or anova(m1, m4)?

*How to interpret output of anova() using three or more models? For example; anova(m1, m2, m3) or anova(m1, m2, m3, m4).


-
 A: *

*If you do anova(m2, m1) it computes the same p-value as anova(m1, m2) so the order is not crucial. However, in the former case the change in degrees of freedom becomes negative which might look confusing in the output. (As pointed out in the other Q/A you referred to.)

*No. It is technically possible to enter anova(m2, m3) but the result is not a valid ANOVA. If you want to compare these models, you can either resort to information criteria (AIC, BIC, ...) or use dedicated tests for non-nested hypotheses (e.g., encompassing test, Vuong test, Cox test, J test, etc.).

*If you carry out anova(m1, m2, m5) this reports two tests which essentially correspond to anova(m1, m2) and anova(m2, m5). However, the error sum of squares is taken from m5 in both of these comparisons which might lead to small differences. Due to 2. the sequence of models must be nested in each step to return valid ANOVAs. But you can do an encompassing test between m2 and m3 by going through m5, i.e., anova(m2, m5, m3).

