Dear Members, I am working on Elastic net and using R package for that. I have two matrix. My response is a matrix of size 50X50 and predictor is also in same size. I want to extract only cloumns from the matrix and do the elastic net analysis then store them as a matrix. library(elasticnet) library(lars) XB<-matrix(rnorm(2500,0,1), ncol=50,nrow=50) y1<-matrix(rnorm(2500,0,1), ncol=50,nrow=50) en1<-enet(x=XB,y=y1[,1],lambda=1,normalize=TRUE,intercept=TRUE) # here I have used one column 1 as my respose coefs<-predict(en1,s=0.45,type="coef",mode="fraction") Here, I want to apply some loop to calculate all the columns and store the all coefficients. Thanks for your help Allisa [[alternative HTML version deleted]]