[R] how to take this experiment with R?

rongguiwong 0034058 at fudan.edu.cn
Tue Sep 21 05:52:04 CEST 2004


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