How to extract the regression coefficient from statsmodels.api?

前端 未结 3 889
余生分开走
余生分开走 2021-02-07 05:34
 result = sm.OLS(gold_lookback, silver_lookback ).fit()

After I get the result, how can I get the coefficient and the constant?

In other words,

3条回答
  •  一向
    一向 (楼主)
    2021-02-07 05:43

    Adding up details on @IdiotTom answer.

    You may use:

    head = pd.read_html(res.summary2().as_html())[0]
    body = pd.read_html(res.summary2().as_html())[1]
    

    Not as nice, but the info is there.

提交回复
热议问题