[R] lm without a formula?

Gabor Grothendieck ggrothendieck at myway.com
Wed May 12 23:05:54 CEST 2004


lm(y~.,data=x)


ivo welch <iaw4 <at> welch.som.yale.edu> writes:

: 
: hi:  I have a y vector and an x data frame.  is it possible to use the 
: standard linear regression (lm, summary.lm) without having to construct 
: a formula, i.e., all x variables should be used.
: 
:     x <- data.frame( rnorm(10), rnorm(10) );  # <-- well, this would 
: really be read from a file
:     y <- rnorm(10);  # ok, also read from the file.
:     lm (y ~ x);  # this is sort of what I want to do, but of course, it 
: is not.
: 
: thanks for any tips.  regards, /iaw




More information about the R-help mailing list