繁体   English   中英

如何使用python中的statsmodels保存由OLS估计的系数的变量显着性?

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM