title: Iteration of columns for linear regression in R
body: <p>I try to select columns in order to make a linear regression.</p>
  
  <p>I tried to make something like this but it does not seems to work</p>
  
  <pre><code>df &lt;- 0
  x &lt;- 0
  for(i in 1:30){
    reg.A_i &lt;- lm(log(match("A", i, sep="_"))~  log(A_0) + B + C , data=y)
    x &lt;- coef(summary(reg.A_i))
    df &lt;- cbind(df[,1],x)
  }
  </code></pre>
  
  <p>My data frame has variables like this:</p>
  
  <pre><code>A_0,  A_1, A_2, A_3 .... A_30, B, C
  </code></pre>