[R] how to take this experiment with R?

Gabor Grothendieck ggrothendieck at myway.com
Tue Sep 21 06:10:15 CEST 2004




You can express your model like this:

   lm(X1 ~., x)

?formula gives some help on formulas although the . notation
above does not seem to be referred to there.


Date:   	Tue, 21 Sep 2004 11:52:04 +0800
From:   	rongguiwong <0034058 at fudan.edu.cn>
To:   	<r-help at stat.math.ethz.ch>
Subject:   	[R] how to take this experiment with R?

i want to generate 30 independent variables and 1 dependent variable,each has
50 draws from a unit normal distribution.
then, searching for the independent variables that together would do the best
job for fitting the denpendent variabe.

my way to generate the data is.
x<-data.frame(matrix(rnorm(1550),c(50,31)))
but is there more better way to do it?

i want to use the followling is to search the model.
model<-step(lm(X1~X2+X3+X4.....))
but i don't know the to express the formula with lm function.i think there is
a way the express it efficently.
i try ?lm .but on result be found.

any help is welcome!




More information about the R-help mailing list