title: Compute linear regression standardized coefficient (beta) with Python
body: <p>I would like to compute the <a href="https://en.wikipedia.org/wiki/Standardized_coefficient" rel="noreferrer">beta or standardized coefficient</a> of a linear regression model using standard tools in Python (numpy, pandas, scipy.stats, etc.).</p>
  
  <p>A friend of mine told me that this is done in R with the following command:</p>
  
  <pre><code>lm(scale(y) ~ scale(x))
  </code></pre>
  
  <p>Currently, I am computing it in Python like this:</p>
  
  <pre><code>from scipy.stats import linregress
  from scipy.stats.mstats import zscore
  
  (beta_coeff, intercept, rvalue, pvalue, stderr) = linregress(zscore(x), zscore(y))
  print('The Beta Coeff is: %f' % beta_coeff)
  </code></pre>
  
  <p>Is there a more straightforward function to compute this figure in Python?</p>