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?
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.