Dear all, Please excuse my ignorance, but I am having difficulty with this, and am unable to find help on the website/Google.
I have a series of explanatory variables that I am aiming to get parsimony out of. For example, if I have 10 variables, a-j, I am initially looking at the linear relationships amongst them: my.lm1 <- lm(a ~ b+c+d+e+f+g+h+i+j, data=my.data) summary(my.lm1) my.lm2 <- lm(b ~ a+c+d+e+f+g+h+i+j, data=my.data) etc Instead of repeatedly typing this in, is there a way to construct a (for) loop of some description to semi-automate this process? In addition, I have several response variables. Instead of examining these individually against the explanatory variables, is there a way to 'group' all response and explanatory variables and then look at all the linear relationship amongst all these variables? I have tried: my.group1 <- c(a,b,c,d,e,f,g,h,i,j) my.group2 <- c(k,l,m,n,o,p,q,r,s,t) my.lm3 <- lm(my.group1 ~ my.group2) to no avail. Thanks for your help, Andy ______________________________________________ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.