# [R-SIG-Mac]bug in lm()?

**Christof Bigler
**
bigler@fowi.ethz.ch

*Fri, 1 Mar 2002 16:30:46 +0100*

After having used lm(), I encountered some odd results in the Darwin
version (Mac G4, OS X Version 10.1.3). Then I tried out this (in the
Darwin and the Carbon version):
>* > dummy1 <- c(1:10)
*>* > dummy2 <- c(1:10)
*
Darwin version (1.4.0):
a)
>* > lm(dummy1~dummy2)
*>*
*>* Call:
*>* lm(formula = dummy1 ~ dummy2)
*>*
*>* Coefficients:
*>* (Intercept) dummy2
*>* 2.442e-15 1.000e+00
*>*
*b)
>* > lm(c(1:10)~c(1:10))
*>*
*>* Call:
*>* lm(formula = c(1:10) ~ c(1:10))
*>*
*>* Coefficients:
*>* (Intercept)
*>* 22
*
Carbon version (1.3.1, yes I know!):
c)
>* > lm(dummy1 ~ dummy2)
*>*
*>* Call:
*>* lm(formula = dummy1 ~ dummy2)
*>*
*>* Coefficients:
*>* (Intercept) dummy2
*>* 0 1
*>*
*d)
>* > lm(c(1:10)~c(1:10))
*>*
*>* Call:
*>* lm(formula = c(1:10) ~ c(1:10))
*>*
*>* Coefficients:
*>* (Intercept)
*>* 5.5
*>*
*
Are there any explanations, why one can get 4 different results
(although just one is correct)?
Christof