Skip to content
Prev 248024 / 398503 Next

lm(y ~ x1) vs. lm(y ~ x0 + x1 - 1) with x0 <- rep(1, length(y))

On Jan 21, 2011, at 9:03 PM, jochen laubrock wrote:

            
You are testing something different. In the first case you are testing  
the difference between the baseline and the second level of x1 (so  
there is only one d.f.), while in the second case you are testing for  
both of the coefficients being zero (so the numerator has 2 d.f.). It  
would be easier to see if you did print() on the fit object. The first  
model would give you an estimate for an "Intercept", which is really  
an estimate for the first level of x1.  Having been taught to think of  
anova as just a special case of regression is helpful here. Look at  
the model first  and only then look at the anova table.
David Winsemius, MD
West Hartford, CT