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]]
You might get better or quicker answers if you ask package-specific questions to the maintainer of the package > maintainer("plm") [1] "Yves Croissant <yves.croissant at univ-reunion.fr>" or to the authors listed in > packageDescription("plm") Package: plm Version: 1.4-0 Date: 2013-12-24 Title: Linear Models for Panel Data Authors at R: c(person(given = "Yves", family = "Croissant", role = c("aut", "cre"), email "yves.croissant at univ-reunion.fr"), person(given = "Giovanni", family = "Millo", role "aut", email = "Giovanni_Millo at Generali.com"), person(given "Arne", family "Henningsen", role = "ctb", email = " arne.henningsen at googlemail.com"), person(given "Ott", family = "Toomet", role = "ctb", email = " otoomet at gmail.com"), person(given "Christian", family = "Kleiber", role = "ctb", email = " Christian.Kleiber at unibas.ch"), person(given = "Achim", family = "Zeileis", role = "ctb", email "Achim.Zeileis at R-project.org")) Bill Dunlap TIBCO Software wdunlap tibco.com On Sun, Nov 1, 2015 at 10:40 AM, Alex I <alexierino at hotmail.com> wrote:> 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]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >[[alternative HTML version deleted]]
Hi Alex, Welcome to the R-help list. This is of no help with your question but a general suggestion. Including your code was great but it probably would help if you also included some sample data. The best way to supply data is to use dput(). See ?dput or have a look athttp://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example and/or http://adv-r.had.co.nz for information on it and other suggestions for asking questions on R-help. dput() provides a 'perfect' copy of your data and ensures that R-help readers see the data exactly as you do on your computer. John Kane Kingston ON Canada> -----Original Message----- > From: alexierino at hotmail.com > Sent: Sun, 1 Nov 2015 18:40:36 +0000 > To: r-help at r-project.org > Subject: [R] Fixed effects estimators doesn't drop or omit > > 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]]____________________________________________________________ Can't remember your password? Do you need a strong and secure password? Use Password manager! It stores your passwords & protects your account.