Re: [R] How to write loop

2009-06-13 Thread Johannes Huesing
Alex Roy [Sun, Jun 14, 2009 at 06:43:52AM CEST]: > Hi Jiim, Thanks . I want to do the following: > > 1. each time I need to drop one column, say first column 1 from matrix X. > 2 then take out row 1 of the remainning matrix and that row becomes > response (y) > 3. do lasso regression on remain

Re: [R] How to write loop

2009-06-13 Thread Alex Roy
Hi Jiim, Thanks . I want to do the following: 1. each time I need to drop one column, say first column 1 from matrix X. 2 then take out row 1 of the remainning matrix and that row becomes response (y) 3. do lasso regression on remaining X to y. 4. store the coefficients Similarly, in next run

[R] How to write loop

2009-06-13 Thread Alex Roy
Dear all, I want to do the following process as a loop ( to run automatically with dimension of X, here 50). How can I do that? Your cooments will be highly appreciable. Alex *# Code:* library(lars) library(chemometrics) X<-matrix(rnorm(2500),ncol=50) dim(X) # [1] 50 50 X1<-X[,