title: Python, Numpy, and OLS
body: <p>The code below works as intended, but it's not quite what I need. I want to to change <code>c[1]</code> to <code>c[1:]</code> so that I regress against all of the x variables instead of just one. When I make that change (and add the appropriate x labels), I get the following error: <code>ValueError: matrices are not aligned</code>. Can someone explain why this is happening and suggest a modification to the code? Thanks.</p>
  
  <pre><code>from numpy import *
  from ols import *
  
  a = [[.001,.05,-.003,.014,.035,-.01,.032,-.0013,.0224,.005],[-.011,.012,.0013,.014,-.0015,.019,-.032,.013,-.04,-.05608],
   [.0021,.02,-.023,.0024,.025,-.081,.032,-.0513,.00014,-.00015],[.001,.02,-.003,.014,.035,-.001,.032,-.003,.0224,-.005],
   [.0021,-.002,-.023,.0024,.025,.01,.032,-.0513,.00014,-.00015],[-.0311,.012,.0013,.014,-.0015,.019,-.032,.013,-.014,-.008],
   [.001,.02,-.0203,.014,.035,-.001,.00032,-.0013,.0224,.05],[.0021,-.022,-.0213,.0024,.025,.081,.032,.05313,.00014,-.00015],
   [-.01331,.012,.0013,.014,.01015,.019,-.032,.013,-.014,-.012208],[.01021,-.022,-.023,.0024,.025,.081,.032,.0513,.00014,-.020015]]
  
  
  c = column_stack(a)
  y = c[0]
  m = ols(y, c[1], y_varnm='y', x_varnm=['x1'])
  print m.summary()
  </code></pre>
  
  <p>EDIT: I came up with a partial solution, but still having a problem. The code below works for 8 of the 9 explanatory variables. </p>
  
  <pre><code>c = column_stack(a)
  y = c[0]
  x = column_stack([c[i] for i in range(1, 9)])
  m = ols(y, x, y_varnm='y', x_varnm=['x1','x2','x3','x4','x5','x6','x7','x8'])
  print m.summary()
  </code></pre>
  
  <p>However, when I attempt to include the 9th x variable, I get the following error: <code>RuntimeWarning: divide by zero encountered in double_scalars</code>. Any idea why? Here's the code (note that <code>len(a)</code> = 10):</p>
  
  <pre><code>c = column_stack(a)
  y = c[0]
  x = column_stack([c[i] for i in range(1, len(a))])
  m = ols(y, x, y_varnm='y', x_varnm=['x1','x2','x3','x4','x5','x6','x7','x8','x9'])
  print m.summary()
  </code></pre>