Statsmodels.formula.api OLS does not show statistical values of intercept

我的未来我决定 提交于 2019-12-06 15:44:21

"No constant is added by the model unless you are using formulas." Therefore try something like below example. Variable names should be defined according to your data set.

Use,

regressor_OLS  = smf.ols(formula='Y_variable ~ X_variable', data=df).fit()

instead of,

regressor_OLS = sm.OLS(endog=y, exog=X).fit()
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!