title: R Multiple Regression Loop and Extract Coefficients
body: <p>I have to perform multiple linear regression for many vectors of dependent variables on the same matrix of independent variables.</p>
  
  <p>For example, I want to create 3 models such that:</p>
  
  <pre><code>lm( d ~ a + b + c )
  lm( e ~ a + b + c )
  lm( f ~ a + b + c )
  </code></pre>
  
  <p>from the following matrix (a,b,c are the independent variables and d,e,f are the dependent variables)</p>
  
  <pre><code>       [,1]     [,2]     [,3]     [,4]     [,5]     [,6]
  [1,]    a1       b1       c1       d1       e1       f1
  [2,]    a2       b2       c2       d2       e2       f2
  [3,]    a3       b3       c3       d3       e3       f3
  </code></pre>
  
  <p>I then want to store the coefficients from the regression in another matrix (I have reduced the number of columns and vectors in my example for ease of explanation).</p>