Testing for time-fixed effects
18
> library(plm)
> fixed <- plm(y ~ x1, data=Panel, index=c("country", "year"),
model="within")
> fixed.time <- plm(y ~ x1 + factor(year), data=Panel, index=c("country",
"year"), model="within")
> summary(fixed.time)
Oneway (individual) effect Within Model
Call:
plm(formula = y ~ x1 + factor(year), data = Panel, model = "within",
index = c("country", "year"))
Balanced Panel: n=7, T=10, N=70
Residuals :
Min. 1st Qu. Median Mean 3rd Qu. Max.
-7.92e+09 -1.05e+09 -1.40e+08 1.48e-07 1.63e+09 5.49e+09
Coefficients :
Estimate Std. Error t-value Pr(>|t|)
x1 1389050354 1319849567 1.0524 0.29738
factor(year)1991 296381559 1503368528 0.1971 0.84447
factor(year)1992 145369666 1547226548 0.0940 0.92550
factor(year)1993 2874386795 1503862554 1.9113 0.06138 .
factor(year)1994 2848156288 1661498927 1.7142 0.09233 .
factor(year)1995 973941306 1567245748 0.6214 0.53698
factor(year)1996 1672812557 1631539254 1.0253 0.30988
factor(year)1997 2991770063 1627062032 1.8388 0.07156 .
factor(year)1998 367463593 1587924445 0.2314 0.81789
factor(year)1999 1258751933 1512397632 0.8323 0.40898
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Total Sum of Squares: 5.2364e+20
Residual Sum of Squares: 4.0201e+20
R-Squared : 0.23229
Adj. R-Squared : 0.17588
F-statistic: 1.60365 on 10 and 53 DF, p-value: 0.13113
> # Testing time-fixed effects. The null is that no time-fixed
effects needed
> pFtest(fixed.time, fixed)
F test for individual effects
data: y ~ x1 + factor(year)
F = 1.209, df1 = 9, df2 = 53, p-value = 0.3094
alternative hypothesis: significant effects
> plmtest(fixed, c("time"), type=("bp"))
Lagrange Multiplier Test - time effects (Breusch-Pagan)
data: y ~ x1
chisq = 0.1653, df = 1, p-value = 0.6843
alternative hypothesis: significant effects
If this number is < 0.05 then
use time-fixed effects. In this
example, no need to use
time-fixed effects.