在plm的双向固定效应模型中是否可以包含一个时不变变量?
模型设置:
`m3 <- plm(habi5 ~ habi1 + habi3 + econ1 + gov1 + gov2 + gov3 + gov4 + soci1 + soci3 + soci4,
data = merge3,
index=c("Name", "Year"),
model="within",
effect = "twoways")`
“ habi1”是随时间变化的变量,其估计值未显示摘要
> summary(m3)
Twoways effects Within Model
Call:
plm(formula = habi5 ~ habi1 + habi3 + econ1 + gov1 + gov2 + gov3 +
gov4 + soci1 + soci3 + soci4, data = merge3, effect = "twoways",
model = "within", index = c("Name", "Year"))
Balanced Panel: n = 103, T = 23, N = 2369
Residuals:
Min. 1st Qu. Median 3rd Qu. Max.
-0.19465878 -0.01498387 -0.00050656 0.01723336 0.20209069
Coefficients:
Estimate Std. Error t-value Pr(>|t|)
habi3 0.0440352 0.0273546 1.6098 0.107585
econ1 -0.1178293 0.0211307 -5.5762 0.00000002755 ***
gov1 -0.0056041 0.0149073 -0.3759 0.707002
gov2 -0.0623383 0.0230207 -2.7079 0.006822 **
gov3 0.0522537 0.0248725 2.1009 0.035765 *
gov4 -0.0726637 0.0306695 -2.3692 0.017909 *
soci1 0.0512043 0.0176959 2.8936 0.003846 **
soci3 0.0653222 0.0140361 4.6539 0.00000344837 ***
soci4 -0.0418018 0.0104464 -4.0015 0.00006498113 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Total Sum of Squares: 3.3689
Residual Sum of Squares: 3.1978
R-Squared: 0.050797
Adj. R-Squared: -0.0056884
F-statistic: 13.2896 on 9 and 2235 DF, p-value: < 0.000000000000000222
在使用plm的当前模型规范中,是否可以估算此变量的影响?
编辑:
这是数据结构的一瞥:
> str(merge3)
'data.frame': 4416 obs. of 55 variables:
$ ISO3 : Factor w/ 192 levels "AFG","AGO","ALB",..: 1 1 1 1 1 1 1 1 1 1 ...
$ Name : Factor w/ 192 levels "Afghanistan",..: 1 1 1 1 1 1 1 1 1 1 ...
$ Year : Factor w/ 23 levels "1995","1996",..: 1 2 3 4 5 6 7 8 9 10 ...
$ Exposure : num 0.481 0.481 0.481 0.481 0.481 ...
$ Sensitivity: num 0.497 0.498 0.498 0.499 0.499 ...
$ Capacity : num 0.893 0.891 0.889 0.883 0.876 ...
$ Economic : num 0.138 0.138 0.138 0.138 0.138 ...
$ Governance : num 0.139 0.139 0.143 0.147 0.142 ...
$ Social : num 0.297 0.297 0.297 0.297 0.297 ...
$ food1 : num 0.702 0.702 0.702 0.702 0.702 ...
$ food2 : num 0.439 0.439 0.439 0.439 0.439 ...
$ food3 : num 0.779 0.779 0.779 0.779 0.779 ...
$ food4 : num 0.845 0.844 0.843 0.842 0.841 ...
$ food5 : num 0.988 0.988 0.988 0.988 0.988 ...
$ food6 : num 0.7 0.7 0.7 0.647 0.595 ...
$ water1 : num 0.442 0.442 0.442 0.442 0.442 ...
$ water2 : num 0.179 0.179 0.179 0.179 0.179 ...
$ water3 : num 0.436 0.436 0.436 0.436 0.436 ...
$ water4 : num 0.287 0.287 0.287 0.287 0.287 ...
$ water5 : num 0.986 0.986 0.986 0.986 0.986 ...
$ water6 : num 0.975 0.953 0.932 0.909 0.888 ...
$ heal1 : num 0.667 0.667 0.667 0.667 0.667 ...
$ heal2 : num 1 1 1 1 1 1 1 1 1 1 ...
$ heal3 : num 0.143 0.143 0.143 0.143 0.143 ...
$ heal4 : num 0.646 0.646 0.646 0.646 0.646 ...
$ heal5 : num 0.99 0.99 0.99 0.99 0.99 ...
$ heal6 : num 0.819 0.813 0.807 0.802 0.796 ...
$ ecos1 : num 0.659 0.659 0.659 0.659 0.659 ...
$ ecos2 : num 0 0 0 0 0 0 0 0 0 0 ...
$ ecos3 : num NA NA NA NA NA NA NA NA NA NA ...
$ ecos4 : num 0.2 0.2 0.2 0.2 0.2 ...
$ ecos5 : num 0.885 0.885 0.885 0.885 0.885 ...
$ ecos6 : num 0.835 0.84 0.845 0.846 0.846 ...
$ habi1 : num 0.0727 0.0727 0.0727 0.0727 0.0727 ...
$ habi2 : num 0.645 0.645 0.645 0.645 0.645 ...
$ habi3 : num 0.216 0.217 0.218 0.219 0.22 ...
$ habi4 : num 0.92 0.925 0.93 0.934 0.936 ...
$ habi5 : num 1 1 1 1 1 1 1 1 1 1 ...
$ habi6 : num 0.827 0.827 0.827 0.827 0.827 ...
$ infr1 : num NA NA NA NA NA NA NA NA NA NA ...
$ infr2 : num NA NA NA NA NA NA NA NA NA NA ...
$ infr3 : num NA NA NA NA NA NA NA NA NA NA ...
$ infr4 : num NA NA NA NA NA NA NA NA NA NA ...
$ infr5 : num 1 1 1 1 0.998 ...
$ infr6 : num 0.713 0.713 0.713 0.713 0.713 ...
$ econ1 : num 0.138 0.138 0.138 0.138 0.138 ...
$ gov1 : num 0.155 0.155 0.154 0.153 0.152 ...
$ gov2 : num 0.132 0.132 0.145 0.157 0.144 ...
$ gov3 : num 0.108 0.108 0.108 0.108 0.106 ...
$ gov4 : num 0.16 0.16 0.165 0.17 0.166 ...
$ soci1 : num 0.701 0.701 0.701 0.701 0.701 ...
$ soci2 : num 0.18 0.18 0.18 0.18 0.18 ...
$ soci3 : num 0.00816 0.00816 0.00816 0.00816 0.00816 ...
$ soci4 : num NA NA NA NA NA NA NA NA NA NA ...
$ gdp : num 860 860 860 860 860 ...
编辑这是CRE模型
Oneway (individual) effect Random Effect Model
(Swamy-Arora's transformation)
Call:
plm(formula = habi5 ~ habi1 + habi2 + lag(habi3) + lag(habi4) +
econ1 + gov1 + gov2 + gov3 + gov4 + soci1 + soci3 + Between(habi3) +
Between(habi4) + Between(econ1) + Between(gov1) + Between(gov2) +
Between(gov3) + Between(gov4) + Between(soci1) + Between(soci3),
data = merge3, model = "random", index = c("Name",
"Year"))
Balanced Panel: n = 122, T = 22, N = 2684
Effects:
var std.dev share
idiosyncratic 0.002051 0.045290 0.301
individual 0.004771 0.069076 0.699
theta: 0.8616
Residuals:
Min. 1st Qu. Median 3rd Qu. Max.
-0.2176500 -0.0229694 0.0026702 0.0265122 0.1893782
Coefficients:
Estimate Std. Error z-value Pr(>|z|)
(Intercept) 0.8323734 0.0777657 10.7036 < 0.00000000000000022 ***
habi1 -0.0429641 0.0453840 -0.9467 0.3438020
habi2 -0.0337758 0.0486177 -0.6947 0.4872301
lag(habi3) 0.0275567 0.0239274 1.1517 0.2494512
lag(habi4) 0.1511430 0.0199840 7.5632 0.000000000000039329 ***
econ1 -0.1311447 0.0246641 -5.3172 0.000000105360004603 ***
gov1 0.0698110 0.0157319 4.4375 0.000009099519320286 ***
gov2 -0.0155454 0.0262203 -0.5929 0.5532635
gov3 -0.0088883 0.0278096 -0.3196 0.7492604
gov4 -0.1844372 0.0346533 -5.3224 0.000000102428273062 ***
soci1 0.0288428 0.0203037 1.4206 0.1554425
soci3 -0.1109754 0.0136005 -8.1596 0.000000000000000336 ***
Between(habi3) 0.1410424 0.0413296 3.4126 0.0006434 ***
Between(habi4) -0.0495365 0.0699775 -0.7079 0.4790123
Between(econ1) 0.0844426 0.0907776 0.9302 0.3522604
Between(gov1) -0.0272422 0.0813623 -0.3348 0.7377567
Between(gov2) -0.3507092 0.1293861 -2.7106 0.0067169 **
Between(gov3) -0.0993777 0.1407993 -0.7058 0.4803057
Between(gov4) -0.0103704 0.2048604 -0.0506 0.9596268
Between(soci1) -0.0131975 0.0619293 -0.2131 0.8312445
Between(soci3) -0.0023736 0.0668733 -0.0355 0.9716855
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Total Sum of Squares: 7.5711
Residual Sum of Squares: 5.4702
R-Squared: 0.27749
Adj. R-Squared: 0.27206
Chisq: 1022.74 on 20 DF, p-value: < 0.000000000000000222