I am fitting an OLS model using statsmodels. I need to return the slope of the fitted line.
model = sm.OLS(y, X)
results = model.fit()
results.fittedvalues
gives me the points of the line. How to get the slope?
I am fitting an OLS model using statsmodels. I need to return the slope of the fitted line.
model = sm.OLS(y, X)
results = model.fit()
results.fittedvalues
gives me the points of the line. How to get the slope?
results.params
contains the "slopes" for all the variables used.
© 2022 - 2024 — McMap. All rights reserved.