From p.dalgaard@biostat.ku.dk  Sun Nov  8 22:19:20 1998
From: p.dalgaard@biostat.ku.dk (Peter Dalgaard BSA)
Date: 08 Nov 1998 23:19:20 +0100
Subject: Strange behaviour of lm
In-Reply-To: Guido Masarotto's message of Sun, 8 Nov 1998 17:34:12 +0100
References: <19981108173412.A2033@sirio.stat.unipd.it>
Message-ID: <x24ss9rfo7.fsf@blueberry.kubism.ku.dk>

Guido Masarotto <guido@sirio.stat.unipd.it> writes:

> R-0.62.4 running under linux
> -------------------------------------------------------------------------------
> > x <- rnorm(10)
> > lm(x~x)
> Error: length of namelist must equal dims

That one is a bug...

> > x <- c(1,2,3)
> > lm(x~x)
> 
> Call:
> lm(formula = x ~ x)
> 
> Coefficients:
> (Intercept)
>           2
> 	  
> > y <- x
> > lm(y~x)
>   
> Call:
> lm(formula = y ~ x)
> 	  
> Coefficients:
> (Intercept)            x
>           0            1

...but the rest is Splus compatible. The dependent is removed from the
right hand side of model formulas. I seem to remember that there's a
reason for that.

-- 
   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
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


Strange behaviour of lm
Peter Dalgaard BSA