python - Reading coef value from OLS regression results -


i use pandas , statsmodels linear regression. however, can't find possible way read results. results displayed need further calculations using coef values. there possible way store coef values new variable?

import statsmodels.api sm import numpy ones = numpy.ones(len(x[0])) t = sm.add_constant(numpy.column_stack((x[0], ones))) m in x[1:]:     t = sm.add_constant(numpy.column_stack((m, t))) results = sm.ols(y, t).fit() 

this image of results

according docs, instance of regressionresults returned.

you can see available attributes there.

maybe interested in:

params

the linear coefficients minimize least squares criterion. called beta classical linear model.

example:

model = sm.ols(y,x) results = model.fit() print(results.params) 

Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -