unexpected behaviour in lm() (PR#3657)
ottk@bms.com writes:
lm(c(1:10) ~ c(1:10))
Call:
lm(formula = c(1:10) ~ c(1:10))
Coefficients:
(Intercept)
5.5
Unexpected: yes, bug: no. Thing is that the lm logic removes the resonse from the set of predictors. This is to support stuff like "y ~ .", I believe. You get the same effect from
x <- c(1:10) lm(x~x)
Call:
lm(formula = x ~ x)
Coefficients:
(Intercept)
5.5
O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk) FAX: (+45) 35327907