title: Put regression summary results in data frame R
body: <p>I am running several regression models  and desire to have the results in a data frame. I tried several methods they have been unsuccessful.</p>
  
  <pre><code># Generate some fake data: three responses and eight covariates 
  df &lt;- data.frame(y1 = rnorm(50), y2 = rnorm(50), y3 = rnorm(50), 
                   aa = rnorm(50), ab = rnorm(50), ca = rnorm(50), 
                   cd = rpois(50, 30), v8 = runif(50)) 
  
  # Create a vector of covariate names 
  xs &lt;- c("aa","ab", "ca","cd","v8") 
  # Initialize a list whose length is that of the vector xs 
  rl1 &lt;- vector('list', 5) 
  rl2 &lt;- vector('list', 5) 
  rl3 &lt;- vector('list', 5) 
  
  for(i in 1:5) { fm1&lt;- as.formula(paste('y1', xs[i], sep = '~')) 
  fm2 &lt;- as.formula(paste('y2', xs[i], sep = '~')) 
  fm3 &lt;- as.formula(paste('y3', xs[i], sep = '~')) 
  rl1[[i]] &lt;- summary(lm(fm1, data = df) )
  rl2[[i]] &lt;- summary(lm(fm2, data = df) )
  rl3[[i]] &lt;- summary(lm(fm3, data = df) )
  } 
  
  rl1
  rl2
  
  ###
  #The goal is to:
  #create a data frame for results that looks like this 
  
  Variable    t value     Pr(&gt;|t|)        
  aa      -1.032      0.3070 
  ab      -0.121      0.9043
  ca       0.041      0.967
  cd       0.429      0.670
  v8      -1.204      0.2346 
  
  and create a data frame for results that looks like this 
  Variable    rl1.t value r2.t value  
  aa      -1.032      -1.846 
  ab      -0.121      -0.230
  ca       0.041      1.347
  cd       0.429      0.211
  v8      -1.204      0.214 
  </code></pre>
  
  <p>Lastly I came across this code to run the regression in this fashion and I want to give credit  and say thanks, although I don't recall the source.</p>