I would like to compute the beta or standardized coefficient of a linear regression model using standard tools in Python (numpy, pandas, scipy.stats, etc.).
A friend of mine told me that this is done in R with the following command:
lm(scale(y) ~ scale(x))
Currently, I am computing it in Python like this:
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)
Is there a more straightforward function to compute this figure in Python?