Liviu Andronic
2010-Apr-09 22:46 UTC
[R] panel regression with twoways random effects, on unbalanced data?
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
Apparently Analagous Threads
- plm "within" models: is the correct F-statistic reported?
- Manual two-way demeaning of unbalanced panel data (Wansbeek/Kapteyn transformation)
- plm(..., model="within", effect="twoways") is very slow on unablanaced data (was: Re: Regressions with fixed-effect in R)
- plm package twoways effect problem
- How could I see the source code of functions in an R package?