Skip to content
Prev 176341 / 398502 Next

loop problem for extract coefficients

Hi Alex,
On Sun, April 5, 2009 16:49, Alex Roy wrote:
The problem is that only the print statement is inside the for loop. I
would suggest:

for(j in 1: 10)
{             # here the opening bracket
print (paste(j,"/200",sep=""))
              # and not here!
enres<-enet(x=X,y=Y[,j],lambda=1,normalize=TRUE,intercept=TRUE)
fit<-predict.enet(enres, X, type="coefficients")
store[,j]<-fit$coefficients
}


Hope this helps,
Arien