1

I am attempting to run a fixed effect model in plm. My two components are "Sector" and "Date"

fixed <- plm(Value ~ Oil, data=Master, index=c("Sector", "Date"), model="within")

The data looks like:

Transportation  ,   03/09/2011
Transportation  ,   03/09/2011
Transportation  ,   03/22/2011
Transportation  ,   04/11/2011
Mining          ,   03/09/2011
Mining          ,   05/21/2011

When I enter the code it says there is an error with duplication. The first two rows of the data create "the same individual". Is there a way around this?

lmo
  • 37,904
  • 9
  • 56
  • 69
L-dan
  • 19
  • 2
  • It is not quite clear what your data structure is, but sometimes I work with data that is like "firm1 industry1 date1 \ firm2 industry1 date1 \" and so on. I want to put in fixed effects for date and industry. I do it like this: `fixed <- lm(y ~ var1 + industry + date)` where industry and date are factor variables. Typically, the coefficients will be equal, but the SEs will be a bit different than the within estimator. – lmo Mar 17 '18 at 18:56

0 Answers0