# Forecasting unemployment rate with plm

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 R

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))!
• Which model should I choose, onestep or twosteps?
• 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?

Regards

-
 I haven't used this package extensively myself. I think individual effect is indeed what you want. Two step will yield smaller standard errors (see the paper i linked to in my original answer). The number of instruments should be smaller than the number of years-1 you have. Try 2:9 (i think you have 9 years per region). You could also start by using the gretl implementation (which is simpler to use) and come back to R whence you have mastered the model a bit. – user603 Oct 21 '10 at 14:33 @kwak but the model specification is correct, isn't it? Btw, why the numbers of instruments should be smaller than years-1? If you look the example of plm vignette with EmplUK data set (p.23) they use 2:99 (I don't really understand why)? I came across the following formula for number of instruments (T-1)*(T-2)/2+(T-3)...I'll have a look at gretl, thx! – teucer Oct 21 '10 at 15:08

It is a known bug in plm package, when effect="individual"  the pgmm crashes. The bug is fixed in plm version 1.2-7.