[英]How to save in a variable significance of a coefficient estimated by OLS using statsmodels in python?
我使用statsmodels.formula.api執行了線性回歸(OLS),並通過以下方式顯示了參數和摘要:
result = sm.ols(formula="items ~ views + price", data=nvo).fit()
print result.params
這非常有用,但是我想將價格系數的意義保留在變量中,我如何添加匯總對象的元素? 具體來說,如何保存R平方,有效值和置信區間?
哦,我設法回答了我自己的問題。 您只需要繼續執行以下操作:
print result.pvalue
print result.conf_int()
print result.rsquared
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.