Thank you @mcreel how would I instruct the FixedEffectModels package so that they implement the GMM estimator?
I would like to implement a model like so
y_{it} = \alpha y_{it-1} + x_{it} \beta + \eta_{i} + \varepsilon_{it}
and estimate it using AB’s GMM methodology. My data look like
where Country
and Year
are individual and time indices.
What formula would implement AB if I want to use lagged values of EVCentrality
as an instrument (here L1
and L2
for lag 1 and lag 2, respectively)?
I was thinking of something along those lines:
reg(formal,@formula(EVCentrality ~ (L1 ~ L2) + fe(Country)))
Perhaps to make this answer even more useful for people other than myself (time permitting), it would be good to have a Julia implementation of the example from Section 6.1 from here.
That is reconstruct the formula (in R
) and then it could even go into the documentation.
This is the R
code I would like to translate:
data(EmplUK, package = "plm")
dat <- EmplUK
dat[,c(4:7)] <- log(dat[,c(4:7)])
names(dat[,c(4:7)]) <- c("n", "w", "k", "ys")
m1 <- pdynmc(dat = dat, varname.i = "firm", varname.t = "year",
use.mc.diff = TRUE, use.mc.lev = FALSE, use.mc.nonlin = FALSE,
include.y = TRUE, varname.y = "emp", lagTerms.y = 2,
fur.con = TRUE, fur.con.diff = TRUE, fur.con.lev = FALSE,
varname.reg.fur = c("wage", "capital", "output"),
lagTerms.reg.fur = c(1,2,2),
include.dum = TRUE, dum.diff = TRUE, dum.lev = FALSE, varname.dum = "year",
w.mat = "iid.err", std.err = "corrected",
estimation = "onestep", opt.meth = "none")