[R] panel regression with twoways random effects, on unbalanced data?
Liviu Andronic
landronimirc at gmail.com
Sat Apr 10 00:46:05 CEST 2010
Dear R users
What would be the best way to approach estimating a panel regression
with twoways random effects, on unbalanced data? Unfortunately, the
"plm" package has no implementation of twoways random effects for
unbalanced data. Currently I'm considering two approaches:
- extend "plm" to cover this type of panel regression. (For the
authors, cc'ed:) Would implementing this be particularly difficult?
Where should one look in the source?
- perform the regressions manually as suggested in “Econometrics in R”
[1]. But what would be the correct lme() syntax for a twoways RE
model? For example,
library("AER")
library("plm")
data("Grunfeld", package = "AER")
pgr <- plm.data(Grunfeld, index = c("firm", "year"))
gr_re <- plm(invest ~ value + capital, data = pgr,
model = "random", effect="individual")
gr_lme <- lme(invest ~ value + capital, Grunfeld, random=~1|firm)
summary(gr_re)
summary(gr_lme)
For this "individual" RE model, both plm() and lme() yield apparently
similar results. While for the "twoways" one not quite:
gr_re <- plm(invest ~ value + capital, data = pgr,
model = "random", effect="twoways", random.method = "amemiya")
gr_lme <- lme(invest ~ value + capital, Grunfeld, random=~1|firm/year)
summary(gr_re)
summary(gr_lme)
Would this be the correct lme() syntax for a "twoways" panel model?
Would it work for unbalanced data?
Any ideas would be great. Thank you
Liviu
[1] http://cran.r-project.org/doc/contrib/Farnsworth-EconometricsInR.pdf
--
Do you know how to read?
http://www.alienetworks.com/srtest.cfm
http://goodies.xfce.org/projects/applications/xfce4-dict#speed-reader
Do you know how to write?
http://garbl.home.comcast.net/~garbl/stylemanual/e.htm#e-mail
More information about the R-help
mailing list