# Including time-varying regional fixed effects in Arellano-Bond estimation (R plm package)

I want to estimate a dynamic panel model with firm level time invariant fixed effects and time-varying regional fixed effects. I'm trying to implement this with R package plm, but I run into trouble when I try to include that time-varying regional fixed effects. Here's what I've done:

df <- plm.data(df, index = c("firm", "year")

fit <- pgmm(formula = y ~ lag(y, 1) + lag(X, 0:1) + region:year |
lag(y, 2:99) + lag(X, 2:99),
data = df, effect = "individual", model = "twosteps",
transformation = "ld")


The system becomes singular and does not solve. I can fix that by replacing region:year with region, but that's not what I want to do. So it seems that regional fixed effects can't be time varying for some reason. Is this intended to be so or is there some workaround available? If R cannot handle this, is there some other program that can?

• Have you tried the latest development version? Something related to pgmm has been fixed two weeks ago: r-forge.r-project.org/R/?group_id=406 – Helix123 Mar 21 '16 at 16:40
• Thanks! I could not find what exactly has changed in new dev version. Nevertheless this is a difficult option for me anyways as I have the data in remote access and the admins do not install dev versions of packages. The plm version I use is 1.5-12. – Antti Mar 22 '16 at 8:01

• I'm not sure about that. I was following the newest plm vignette and that's where I got my template for the formula. The post you found is already seven years old and perhaps the current approach was not available yet? I found that in older vignette versions dynformula is mentioned but not anymore in the latest vignette. Perhaps that is deprecated nowadays? – Antti Apr 6 '16 at 12:10
If you have small N and large T, you could try the phtt package (https://mran.microsoft.com/snapshot/2016-11-30/web/packages/phtt/vignettes/phtt.pdf).
I am yet to find where the Ahn et al (2013) model has been implemented in R. The tvFE package (https://rdrr.io/cran/tvReg/man/tvFE.html) should get you part-way there.