如何将OLS回归结果F-statsistic和R-squared存储到列表中

时间:2015-10-08 17:21:51

标签: python numpy pandas regression statsmodels

如何在列表中指定OLS回归结果F-statsistic和R-squared?例如:

ols('x ~ a + b + c', data).fit()
ols_model.summary()

OLS Regression Results
Dep. Variable:  x         R-squared:    0.901
Model:  OLS               Adj. R-squared:   0.799
Method: Least Squares     F-statistic:  598.1
Date:   Thu, 08 jan 2013  Prob (F-statistic):   0.01
Time:   09:07:22          Log-Likelihood:   280.00
No. Observations:   110   AIC:  -910.0
Df Residuals:       250   BIC:  -910.1
Df Model:           3       
Covariance Type:    robust  

我可以将输出存储在像这样的变量

x = model.rsquared

x

0,901

但是以下代码没有任何结果:

df['x'] = x

type(x)给出numpy.float64 btw。

希望有人可以帮忙!感谢。

0 个答案:

没有答案