Skip to content
Prev 248026 / 398503 Next

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

Thank you all (including Dennis), this was elucidating. 

I would have (maybe naively) anticipated that in this somewhat pathological case of fitting without an intercept and re-introducing it via constant x1, R might check whether the design matrix includes a column of ones, and adjust the degrees of freedom accordingly. But now I can see that by explicitly requesting via the formula interface not to fit a constant, I am implicitly stating my hypothesis that y==0, even if I re-introduce my suspicion that y==mu via x1 <- 1. If I understood correctly, x1 is treated as a variable in the latter case, right?
On Jan 22, 2011, at 5:18 , Bert Gunter wrote:

            
----
Jochen Laubrock, Dept. of Psychology, University of Potsdam,
Karl-Liebknecht-Strasse 24-25, 14476 Potsdam, Germany
phone: +49-331-977-2346, fax: +49-331-977-2793