2

An example:

load(url('BROKEN LINK'))
head(sdat)
library(plm)
fem = plm(y~T+G:t,data=sdat,effect="twoways",model="within",index=c("ID","t"))
summary(fem)
lsdvm = lm(y~ID+T+G:t,data=sdat)
summary(lsdvm)
fem$coef

fem is the fixed-effects model (fit with plm), and lsdv is the equivalent least-squares dummy variable model (fit with lm)

It is clear that plm is estimating the coefficients, and indeed that the coefficients are identical in the two models, as they should be. But when I go to summarize the results, plm is having a hard time, and I'm pretty sure that the reason is the timeXgroup fixed effects, some of which need to be auto-omitted because of the dummy variable trap. (lm, for example, seems to know how to automatically remove variables that are exact linear combinations of each other).

How do I get around this? I'd prefer to stay with plm, as it gives much more parsimonious output than lm with dummy variables for each cross-sectional unit.

generic_user
  • 3,430
  • 3
  • 32
  • 56
  • did you found an answer, yet? – NaN Jul 21 '15 at 07:50
  • This looks related, though I have not run your code to verify: https://stackoverflow.com/questions/17737159/controlling-the-value-true-or-false-of-dummy-variables-in-interaction-terms-wh – Hack-R Oct 14 '15 at 15:21
  • This should be fixed in one of the more recent versions of plm. – Helix123 Mar 08 '17 at 21:58

0 Answers0