I'm trying a loop like this, where I want to assign the name of the matrix column dynamically:
for(i in 1:nclass){
P <- eXb / SeXb[mydata$chid]
mydata <- cbind(mydata, paste("l_", i, sep="")=P)
}
Any idea (apart from changing colnames ex-post)?
Thanks