I put up a fixed effects regression using panel data with a time lag of the dependant variable, so somthing like this:
library(plm) library(lmtest) attach(data) panel_data <- pdata.frame(data, index = c("country","time")) model1 <- plm(Y~Y_l1+A+B+C, data = panel_data, model = "within", effect = "twoway")
Where Y_l1 is the time lag of the dependant variable and A,B,C are other explanatory variables. I am using robust st. err. as well
robmodel <- coeftest(model1, vcov.=vcovHC(model1, method = c("arellano")))
My advisor now told me that as my number of time periods is rather small (its about 15) I should include GMM estimators for dynamic panels. He said it is fairly simple to include them in Stata, I however use R, therefore, I wanted to know if there is a simple way to include them in R as well? Is it possible to do it with one line of code?