[R] Why removing the (Intercept) from lm is done by adding -1?

mviljamaa mviljamaa at kapsi.fi
Wed Sep 21 16:19:42 CEST 2016


So I found out that to remove the (Intercept) term from lm's model one 
can add -1 to the predictors. I.e. do lm(resp ~ x1 + x2 - 1)

Another way is to add 0, e.g. lm(resp ~ 0 + x1 + x2).

Adding (or setting the (Intercept) term) zero seems more logical than 
subtracting one, but why is there the method of subtracting one? Why 
does subtracting one mean that the (Intercept) term disappears?



More information about the R-help mailing list