我正在使用plm
软件包进行固定效应回归分析。为什么和如何调整ID代码的顺序会影响回归结果?
我使用以下代码进行回归分析,只有Company
和Year
的ID代码顺序不同。
代码:
MV_Year <- plm (MVlog ~ LEV + Size + DY + RDlog
, data=Values, model="within", index= c("Year","Company"))
MV_Company <- plm (MVlog ~ LEV + Size + DY + RDlog,
data=Values, model="within", index= c("Company", "Year"))
对应的输出: MV_Year:
Oneway (individual) effect Within Model
Call:
plm(formula = MVlog ~ LEV + Size + DY + RDlog, data = Values,
model = "within", index = c("Year", "Company"))
Unbalanced Panel: n = 17, T = 557-4280, N = 29890
Residuals:
Min. 1st Qu. Median 3rd Qu. Max.
-5.250901 -0.457100 0.015763 0.476140 6.006483
Coefficients:
Estimate Std. Error t-value Pr(>|t|)
LEV -1.95485031 0.04060539 -48.143 < 2e-16 ***
Size 0.75233709 0.00314849 238.952 < 2e-16 ***
DY -0.00033192 0.00013482 -2.462 0.01382 *
RDlog 0.13148626 0.00300509 43.755 < 2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Total Sum of Squares: 102610
Residual Sum of Squares: 17568
R-Squared: 0.82879
Adj. R-Squared: 0.82868
F-statistic: 36148 on 4 and 29869 DF, p-value: < 2.22e-16
MV_Company
Oneway (individual) effect Within Model
Call:
plm(formula = MVlog ~ LEV + Size + DY + RDlog, data = Values,
model = "within", index = c("Company", "Year"))
Unbalanced Panel: n = 5911, T = 1-17, N = 29890
Residuals:
Min. 1st Qu. Median 3rd Qu. Max.
-4.35967 -0.38711 0.00000 0.40528 5.48624
Coefficients:
Estimate Std. Error t-value Pr(>|t|)
LEV -1.88958140 0.04392991 -43.0135 < 2e-16 ***
Size 0.74650676 0.00375926 198.5782 < 2e-16 ***
DY -0.00034308 0.00014585 -2.3524 0.01866 *
RDlog 0.13904360 0.00331886 41.8950 < 2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Total Sum of Squares: 58168
Residual Sum of Squares: 12747
R-Squared: 0.78085
Adj. R-Squared: 0.72679
F-statistic: 21356.2 on 4 and 23975 DF, p-value: < 2.22e-16
为什么在不同的估计和R^2之间会有这些小差异?