[R] Fixed effects estimators doesn't drop or omit

Alex I alexierino at hotmail.com
Sun Nov 1 19:40:36 CET 2015


The title says it all, really. Fixed effects in the plm package still estimates coefficients for time invariant variables. Now, if this isn't normal, you might think this is a data entry issue, but I don't think it is a data entry issue. Hausman-Taylor in the plm package correctly distinguishes the time invariants from the time variants using the same data. 

So, is this normal? Am I supposed to omit them myself? Do I run the regression including them but excluding their results when I display it to my reader? See below for the code I am using.


library(plm)
mydata <- read.csv(file="FILE.csv",head=TRUE,sep=",")


Y <- cbind(mydata$lnTRADE) 
X <- cbind(mydata$lnGDPi, mydata$lnGDPj, mydata$lnDIST, mydata$lnIPRi, mydata$lnIPRj, mydata$lnGDP.SIM, mydata$C.BORD, mydata$C.LANG, mydata$EUZ) 


# Fixed effects panel regression 
fixed <- plm(Y ~ X, data=pdata, model= "within") 
summary(fixed) 
pbgtest(fixed)
coeftest(fixed, vcov = vcovHC(fixed, type = "HC0"))


library(plm)
mydata <- read.csv(file="FILE.csv",head=TRUE,sep=",")

Y <- cbind(mydata$lnTRADE) 
X <- cbind(mydata$lnGDPi, mydata$lnGDPj, mydata$lnDIST, mydata$lnIPRi, mydata$lnIPRj, mydata$lnGDP.SIM, mydata$C.BORD, mydata$C.LANG, mydata$EUZ) 

# Fixed effects panel regression 
fixed <- plm(Y ~ X, data=pdata, model= "within") 
summary(fixed) 
pbgtest(fixed)
coeftest(fixed, vcov = vcovHC(fixed, type = "HC0"))
	[[alternative HTML version deleted]]



More information about the R-help mailing list