|
> library(plm)
> data<-read.table("clipboard",header=T,sep='\t')
> data
> pgr<-plm.data(data,index = c("country", "year"))
> gr_pool<-plm(y ~ x1+x4, data = pgr, model="pooling")
> gr_fe <- plm(y ~ x1 + x4, data = pgr, model = "within")
> gr_re<-plm(y~x1+x4,data = pgr,model="random",random.method = "swar")
> pFtest(gr_fe, gr_pool)
F test for individual effects
data: y ~ x1 + x4
F = 30.9114, df1 = 14, df2 = 148, p-value < 2.2e-16
alternative hypothesis: significant effects
> pFtest(gr_fe, gr_pool)
F test for individual effects
data: y ~ x1 + x4
F = 30.9114, df1 = 14, df2 = 148, p-value < 2.2e-16
alternative hypothesis: significant effects
> phtest(gr_re, gr_fe)
Hausman Test
data: y ~ x1 + x4
chisq = 34.5458, df = 2, p-value = 3.151e-08
alternative hypothesis: one model is inconsistent
|