0

I want to compare the estimations of the following models but I don't know if I can estimate models (5) with the plm package:

1/ pooled -> Yit

fit.pooling <- plm(form, data = pdata, model = "pooling")

2/ Within (ind/time/both effects) -> Yit - Yi. / Yit - Yt. / Yit - Yi. - Yt.

fit.fe <- plm(form, data = pdata, model = "within", effect="ind"/"time"/"twoways")

3/ Between (ind/time effects)-> Yi. / Yt.

fit.bet <- plm(form, data = pdata, model = "between", effect="ind"/"time")

4/ Random effect (ind/time/both effects)-> Yit - aYi. / Yit - aYt. / Yit - aYi. - bYt.

fit.re <- plm(form, data = pdata, model = "random", effect="ind"/"time"/"twoways")

5/ Random effect with fixed time effect or Random effect with fixed ind effect ? -> Yit - aYi. - Yt. / Yit - aYt. - Yi.

Can I estimate those models with plm package?

tristanjou
  • 35
  • 8

1 Answers1

1

Let's split 5) in 5.1) and 5.2):

5.1) random individual effect with fixed time effect

5.2) random time effect with fixed individual effect.

This type of model, Baltagi calls a mixed error component model in his text book and - I think - EViews calls it a mixed model (but it is not to be mistaken as a mixed effect model in the MLE context).

Both can be fitted with plm like this:

5.1)

fit.mix5.1 <- plm(<your formula + factor(timeindex)>, data = pdata, model = "random", effect = "individual")

5.2)

fit.mix5.2 <- plm(<your formula + factor(indindex)>, data = pdata, model = "random", effect = "time")

Where factor(timeindex) or factor(indindex) is the time or individual index as a factor, respectively.

Helix123
  • 3,502
  • 2
  • 16
  • 36
  • Thanks for the help. But I've obtained weird results with the following error message : "Error in solve.default(crossprod(ZBeta)) : Lapack routine dgesv: system is exactly singular: U[17,17] = 0". If I delete all but one variable from the model, the code works but I still obtain the following warning messages : " Warning messages: 1: In is.pbalanced.default(index[[1]], index[[2]]) : duplicate couples (id-time) 2: In is.pbalanced.default(index[[1]], index[[2]]) : duplicate couples (id-time)" Do you know the source of the error? Thanks again. – tristanjou Feb 26 '18 at 11:26