> dset <- read.csv("psample.csv", header=TRUE) > dset <- plm.data(dset,index = c("pref","year")) > panel.fe <- plm(y ~ x1 + x2,data = dset, model = "within") > summary(panel.fe) Oneway (individual) effect Within Model Call: plm(formula = y ~ x1 + x2, data = dset, model = "within") Balanced Panel: n=47, T=2, N=94 Residuals : Min. 1st Qu. Median 3rd Qu. Max. -13.30 -3.82 0.00 3.82 13.30 Coefficients : Estimate Std. Error t-value Pr(>|t|) x1 -0.0348879 0.0079323 -4.3982 1.091e-05 *** x2 -0.0512034 0.0071599 -7.1514 8.591e-13 *** --- Signif. codes: 0 e***f 0.001 e**f 0.01 e*f 0.05 e.f 0.1 e f 1 Total Sum of Squares: 15227 Residual Sum of Squares: 2760.5 Multiple R-Squared: 0.81871 F-statistic: 101.611 on 45 and 2 DF, p-value: 0.009791 > summary(fixef(panel.fe)) Estimate Std. Error t-value Pr(>|t|) 1 -150.1385 19.1947 -7.8219 5.107e-15 *** 2 22.7327 16.0890 1.4129 0.1576757 3 48.3265 19.9184 2.4262 0.0152568 * 4 158.7981 19.3883 8.1904 2.220e-16 *** 5 158.8505 16.8725 9.4147 < 2.2e-16 *** 6 158.4821 18.2762 8.6715 < 2.2e-16 *** 7 -106.3124 21.0176 -5.0583 4.231e-07 *** 8 -174.1497 21.0867 -8.2587 2.220e-16 *** 9 -169.1110 21.2069 -7.9743 1.554e-15 *** 10 -184.9825 21.3439 -8.6668 < 2.2e-16 *** 11 -49.8953 20.7668 -2.4026 0.0162770 * 12 75.1225 22.0833 3.4018 0.0006695 *** 13 91.7390 26.6847 3.4379 0.0005863 *** 14 -199.1469 22.0193 -9.0442 < 2.2e-16 *** 15 22.1273 20.8030 1.0637 0.2874833 16 194.6847 20.9938 9.2734 < 2.2e-16 *** 17 182.4541 21.1110 8.6426 < 2.2e-16 *** 18 39.0886 22.2727 1.7550 0.0792587 . 19 29.1342 20.9379 1.3915 0.1640867 20 -56.2834 20.2575 -2.7784 0.0054628 ** 21 -152.6147 21.2583 -7.1791 7.019e-13 *** 22 15.5955 23.3528 0.6678 0.5042471 23 97.5255 22.4862 4.3371 1.444e-05 *** 24 63.8128 22.4329 2.8446 0.0044466 ** 25 -174.4410 24.3285 -7.1702 7.487e-13 *** 26 -197.5232 19.5640 -10.0963 < 2.2e-16 *** 27 217.3341 20.1010 10.8121 < 2.2e-16 *** 28 27.2757 20.0920 1.3575 0.1746084 29 144.2053 19.5297 7.3839 1.537e-13 *** 30 -236.0941 17.7919 -13.2698 < 2.2e-16 *** 31 -9.3991 17.7716 -0.5289 0.5968843 32 192.6278 18.6446 10.3316 < 2.2e-16 *** 33 94.9091 20.1228 4.7165 2.399e-06 *** 34 200.6272 19.5952 10.2386 < 2.2e-16 *** 35 140.3686 19.5418 7.1830 6.819e-13 *** 36 71.8921 19.4968 3.6874 0.0002266 *** 37 -227.1047 19.1285 -11.8726 < 2.2e-16 *** 38 128.0655 17.8390 7.1790 7.023e-13 *** 39 -52.2962 17.6297 -2.9664 0.0030133 ** 40 -161.4507 18.4533 -8.7492 < 2.2e-16 *** 41 -269.3602 17.1807 -15.6780 < 2.2e-16 *** 42 24.1626 15.7891 1.5303 0.1259337 43 -156.6291 16.9615 -9.2344 < 2.2e-16 *** 44 -55.2236 19.4501 -2.8392 0.0045220 ** 45 206.6417 18.0741 11.4330 < 2.2e-16 *** 46 51.0083 16.1322 3.1619 0.0015675 ** 47 -75.4357 15.1513 -4.9788 6.397e-07 *** --- Signif. codes: 0 e***f 0.001 e**f 0.01 e*f 0.05 e.f 0.1 e f 1 > panel.re <- plm(y ~ x1 + x2,data = dset, model = "random") > summary(panel.re) Oneway (individual) effect Random Effect Model (Swamy-Arora's transformation) Call: plm(formula = y ~ x1 + x2, data = dset, model = "random") Balanced Panel: n=47, T=2, N=94 Effects: var std.dev share idiosyncratic 61.3445 7.8323 0.0029 individual 20929.9846 144.6720 0.9971 theta: 0.96175 Residuals : Min. 1st Qu. Median 3rd Qu. Max. -19.500 -3.980 0.805 5.170 18.800 Coefficients : Estimate Std. Error t-value Pr(>|t|) (intercept) 432.6780051 28.5885978 15.1346 < 2.2e-16 *** x1 -0.0347149 0.0078428 -4.4263 9.586e-06 *** x2 -0.0511938 0.0070567 -7.2547 4.027e-13 *** --- Signif. codes: 0 e***f 0.001 e**f 0.01 e*f 0.05 e.f 0.1 e f 1 Total Sum of Squares: 17984 Residual Sum of Squares: 5481.5 Multiple R-Squared: 0.69521 F-statistic: 103.784 on 91 and 2 DF, p-value: 0.0095881 > phtest(panel.fe,panel.re) Hausman Test data: y ~ x1 + x2 chisq = 0.0445, df = 2, p-value = 0.978 alternative hypothesis: one model is inconsistent >