Re: [R] lm and loop over variables

2011-11-21 Thread Johannes Radinger
Hi, Original-Nachricht > Datum: Mon, 21 Nov 2011 14:46:17 +0100 > Von: Uwe Ligges > An: Johannes Radinger > CC: r-help@r-project.org > Betreff: Re: [R] lm and loop over variables > > > On 21.11.2011 13:34, Johannes Radinger wrote: > > Hello, &

Re: [R] lm and loop over variables

2011-11-21 Thread Uwe Ligges
On 21.11.2011 13:34, Johannes Radinger wrote: Hello, I think I am not to far from a solution. I want to do lm regressions with several variables which I define before in a list. What I've done so far is like: y<- c(1,5,6,2,5,10) # response x1<- c(2,12,8,1,16,17) # predictor x2<- c(2,14,5,1,

[R] lm and loop over variables

2011-11-21 Thread Johannes Radinger
Hello, I think I am not to far from a solution. I want to do lm regressions with several variables which I define before in a list. What I've done so far is like: y <- c(1,5,6,2,5,10) # response x1 <- c(2,12,8,1,16,17) # predictor x2 <- c(2,14,5,1,17,17) df <- data.frame(y,x1,x2) predictorlist