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 <[EMAIL PROTECTED]>
To:     <[EMAIL PROTECTED]>
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!

______________________________________________
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to