title: R's lm function in Pandas
body: <p>I have the following <code>lm</code> function in R:</p>
  
  <pre><code>in_data &lt;- c(0.5, 0.6, 0.7)
  minutes &lt;- c(30, 60, 90)
  foobar &lt;- lm(log(in_data) ~ 0 + hours)
  </code></pre>
  
  <p>Questions</p>
  
  <ul>
  <li>I understand the <code>~</code> operator is used to separate the left- and
  right-hand sides in a model formula. So in this case, does it
  translate to <code>log(in_data) is dependent on 0 and hours</code>??? I'm totally lost here, especially on how the log of a vector depends on 0 and another vector </li>
  <li>If I were to attempt to port this to Pandas, what would be the most straightforward way? I tried something on the lines of:</li>
  </ul>
  
  <p>.</p>
  
  <pre><code>import statsmodels.formula.api as sm
  import numpy as np
  result = sm.ols(formula="np.log(in_data) ~ 0 + minutes", data=model_data).fit()
  </code></pre>
  
  <p>But that threw an error:</p>
  
  <pre><code>patsy.PatsyError: Number of rows mismatch between data argument and np.log(in_data) (1 versus 4)
      np.log(in_data) ~ 0 + minutes
      ^^^^^^^^^^^^^^^^^
  </code></pre>