Python OLS中的R^2调整值不一致
我正在使用0.7.3版的Python OLS中的R^2调整值不一致,python,pandas,Python,Pandas,我正在使用0.7.3版的pandas.ols函数。在使用简单回归与窗口回归时,我似乎得到了调整后的$R^2$的不一致值。例如,如果realizedData和pastData有600个条目,那么 model = pandas.ols(y = realizedData, x = pastData, intercept = 0, window = 600) 生成以下输出:- -------------------------Summary of Regression Analysis--------
pandas.ols
函数。在使用简单回归与窗口回归时,我似乎得到了调整后的$R^2$的不一致值。例如,如果realizedData
和pastData
有600个条目,那么
model = pandas.ols(y = realizedData, x = pastData, intercept = 0, window = 600)
生成以下输出:-
-------------------------Summary of Regression Analysis-------------------------
Formula: Y ~ <1> + <10> + <90000>
Number of Observations: 596
Number of Degrees of Freedom: 3
R-squared: 0.6914
Adj R-squared: 0.6904
Rmse: 699.4880
F-stat (3, 593): 664.3691, p-value: 0.0000
Degrees of Freedom: model 2, resid 593
-----------------------Summary of Estimated Coefficients------------------------
Variable Coef Std Err t-stat p-value CI 2.5% CI 97.5%
--------------------------------------------------------------------------------
1 0.4171 0.0428 9.75 0.0000 0.3333 0.5010
10 0.4362 0.0688 6.34 0.0000 0.3014 0.5709
90000 0.0623 0.0319 1.95 0.0517 -0.0003 0.1249
---------------------------------End of Summary---------------------------------
给出:-
-------------------------Summary of Regression Analysis-------------------------
Formula: Y ~ <1> + <10> + <90000>
Number of Observations: 596
Number of Degrees of Freedom: 3
R-squared: 0.6914
Adj R-squared: 0.3053
Rmse: 699.4880
F-stat (3, 593): 1.7909, p-value: 0.1477
Degrees of Freedom: model 2, resid 593
-----------------------Summary of Estimated Coefficients------------------------
Variable Coef Std Err t-stat p-value CI 2.5% CI 97.5%
--------------------------------------------------------------------------------
1 0.4171 0.0428 9.75 0.0000 0.3333 0.5010
10 0.4362 0.0688 6.34 0.0000 0.3014 0.5709
90000 0.0623 0.0319 1.95 0.0517 -0.0003 0.1249
---------------------------------End of Summary---------------------------------
----------------------------回归分析总结-------------------------
公式:Y~++
观察次数:596
自由度:3
R平方:0.6914
调整R平方:0.3053
Rmse:699.4880
F-stat(3593):1.7909,p-value:0.1477
自由度:模型2,剩余593
-----------------------估计系数摘要------------------------
可变系数标准误差t-stat p值CI 2.5%CI 97.5%
--------------------------------------------------------------------------------
1 0.4171 0.0428 9.75 0.0000 0.3333 0.5010
10 0.4362 0.0688 6.34 0.0000 0.3014 0.5709
90000 0.0623 0.0319 1.95 0.0517 -0.0003 0.1249
---------------------------------摘要结束---------------------------------
请注意,除了调整后的$R^2$值外,输出是相同的
这是一个bug还是我做错了什么?我认为这与没有拦截有关。你能在GitHub上报告一个问题吗?我认为这与缺少拦截有关。你能在GitHub上报告一个问题吗
-------------------------Summary of Regression Analysis-------------------------
Formula: Y ~ <1> + <10> + <90000>
Number of Observations: 596
Number of Degrees of Freedom: 3
R-squared: 0.6914
Adj R-squared: 0.3053
Rmse: 699.4880
F-stat (3, 593): 1.7909, p-value: 0.1477
Degrees of Freedom: model 2, resid 593
-----------------------Summary of Estimated Coefficients------------------------
Variable Coef Std Err t-stat p-value CI 2.5% CI 97.5%
--------------------------------------------------------------------------------
1 0.4171 0.0428 9.75 0.0000 0.3333 0.5010
10 0.4362 0.0688 6.34 0.0000 0.3014 0.5709
90000 0.0623 0.0319 1.95 0.0517 -0.0003 0.1249
---------------------------------End of Summary---------------------------------