Please see question for the background.
Following the advice of @kwak and @Andy W, I have decided to use the package plm in
R to fit my model. Here an excerpt of the data
df (the numbers are made up, not real data!):
reg year ur mur cl 1 1 2001 0.000698717 0.012483361 1 2 2 2001 0.008283762 0.011899896 1 3 3 2001 0.001863817 0.012393738 1 4 4 2001 0.005344206 0.012126016 1 5 5 2001 0.007475083 0.011962102 1 6 6 2001 0.002785111 0.012322869 1
where reg is the region indicator, year is the year of measurement, ur is the unemployment rate, mur is the average unemployment rate in the neighboring regions (given by cl) excluding the current region (see @kwak suggestion). Below is the code that I used in
fm <- pgmm(log(ur)~lag(log(ur),1)+log(mur)|lag(log(ur),2:40),data=df)
I have several question regarding this model:
- I guess I should choose
effect="individual"to avoid having time dependent intercepts (?). But doing so the code is crashing (Error in names(coefficients) <- c(namesX, namest))!
modelshould I choose,
- How do I decide on the numbers of instruments (40 is just a guess)?
Assuming that I have fitted this model successfully, how do I simulate from it?