4

I try to learn how to use the GMM method with R (Arellano-Bond estimator). So I use the pgmm command from the package plm.

I reproduced the code of this example: https://www.rdocumentation.org/packages/plm/versions/1.6-5/topics/pgmm

with these data:

Date        country       credit    a   b   c   d   e   f   g    h  i   j   

2000-01-01  Germany     3840,304    0   0   0   0   0   0   1   .b  0   -1
2000-04-01  Germany     3891,104    0   0   0   0   0   0   0   .b  0   0
2000-07-01  Germany     3916,966    0   0   0   0   0   0   0   .b  0   0
2000-10-01  Germany     3984,611    0   0   0   0   0   0   0   .b  0   0
2001-01-01  Germany     4003,066    0   0   0   0   0   0   0   .b  0   0
2001-04-01  Germany     4012,048    0   0   0   0   0   0   0   .b  0   0
2001-07-01  Germany     4053,672    0   0   0   0   0   0   0   .b  0   0
2001-10-01  Germany     4097,941    0   0   0   0   0   0   0   .b  0   0
2002-01-01  Germany     4108,002    0   0   0   0   0   0   0   .b  0   0
2002-04-01  Germany     4142,119    0   0   0   0   0   0   0   .b  0   0
2002-07-01  Germany     4210,727    0   0   0   0   0   0   0   .b  0   0
2002-10-01  Germany     4220,897    0   0   0   0   0   0   0   .b  0   0
2003-01-01  Germany     4280,548    0   0   0   0   0   0   0   .b  0   0
2003-04-01  Germany     4331,072    0   0   0   0   0   0   0   .b  0   0
2003-07-01  Germany     4322,555    0   0   0   0   0   0   0   .b  0   0
2003-10-01  Germany     4338,01     0   0   0   0   0   0   0   .b  0   0
2004-01-01  Germany     4370,032    0   0   0   0   0   0   0   .b  0   0
2004-04-01  Germany     4354,935    0   0   0   0   0   0   0   .b  0   0
2004-07-01  Germany     4375,466    0   0   0   0   0   0   0   .b  0   0
2004-10-01  Germany     4390,958    0   0   0   0   0   0   0   .b  0   0
2005-01-01  Germany     4396,222    0   0   0   0   0   0   0   .b  0   0
2005-04-01  Germany     4448,471    0   0   0   0   0   0   0   .b  0   0
2005-07-01  Germany     4471,893    0   0   0   0   0   0   0   .b  0   0
2005-10-01  Germany     4451,653    0   0   0   0   0   0   0   .b  0   0
2006-01-01  Germany     4477,181    0   0   0   0   0   0   0   .b  0   0
2006-04-01  Germany     4497,384    0   0   0   0   0   0   0   .b  0   0
2006-07-01  Germany     4545,383    0   0   0   0   0   0   0   .b  0   0
2006-10-01  Germany     4527,901    0   0   0   0   0   0   0   .b  0   0
2007-01-01  Germany     4523,691    0   0   0   0   0   0   1   .b  0   0
2007-04-01  Germany     4514,656    0   0   0   0   0   0   0   .b  0   0
2007-07-01  Germany     4510,95     0   0   0   0   0   0   0   .b  0   0
2007-10-01  Germany     4552,084    0   0   0   0   0   0   0   .b  0   0
2008-01-01  Germany     4577,551    0   0   0   0   0   0   0   .b  0   0
2008-04-01  Germany     4590,665    0   0   0   0   0   0   0   .b  0   0
2008-07-01  Germany     4619,162    0   0   0   0   0   0   0   .b  0   0
2008-10-01  Germany     4719,901    0   0   0   0   0   0   0   .b  0   0
2009-01-01  Germany     4747,204    0   0   0   0   0   0   0   .b  0   0
2009-04-01  Germany     4788,791    0   0   0   0   0   0   0   .b  0   0
2009-07-01  Germany     4794,392    0   0   0   0   0   0   0   .b  0   0
2009-10-01  Germany     4803,617    0   0   0   0   0   0   0   .b  0   0
2010-01-01  Germany     4832,948    0   0   0   0   0   0   0   .b  0   0
2010-04-01  Germany     4925,639    0   0   0   0   0   0   0   .b  0   0
2010-07-01  Germany     4971,252    0   0   0   0   0   0   0   .b  0   0
2010-10-01  Germany     5122,327    0   0   0   0   0   0   0   .b  0   0
2011-01-01  Germany     5041,913    0   0   0   0   0   0   1   .b  0   0
2011-04-01  Germany     5079,78     0   0   0   0   0   0   0   .b  0   0
2011-07-01  Germany     5207,961    0   0   0   0   0   0   0   .b  0   0
2011-10-01  Germany     5231,821    0   0   0   0   0   0   0   .b  0   0
2012-01-01  Germany     5280,251    0   0   0   0   1   0   0   .b  0   -1
2012-04-01  Germany     5392,063    0   0   0   0   0   0   0   .b  0   0
2012-07-01  Germany     5400,905    0   0   0   0   0   0   0   .b  0   0
2012-10-01  Germany     5412,811    0   0   0   0   0   0   0   .b  0   0
2013-01-01  Germany     5422,592    0   0   0   0   0   0   0   .b  0   0
2013-04-01  Germany     5430,467    0   0   0   0   0   0   0   .b  0   0
2013-07-01  Germany     5398,361    0   0   0   0   0   0   0   .b  0   0
2013-10-01  Germany     5432,462    0   0   0   0   0   0   0   .b  0   0
2014-01-01  Germany     5456,415    0   0   0   0   1   0   1   .b  0   0
2014-04-01  Germany     5504,142    0   0   0   0   0   0   0   .b  0   0
2014-07-01  Germany     5516,876    0   0   0   0   0   0   0   .b  0   0
2014-10-01  Germany     5532,75     0   0   0   0   0   0   0   .b  0   0

The dependent variable is "credit", and a,b,c.... are the independent ones. The latter are macroprudential and monetary policies. So I try to see the impact of these policies (plus the lagged dependent variable) on credit growth.

For these policies, the index takes a value of 1 when they are tightened, 0 when there is no changes and -1 if they are loosened.

I tried several times, and I have always the same error: Error in terms.default(formula) : no terms component nor attribute

Some attempt:

test <- pgmm(credit) ~ lag(credit)+lag(a)+lag(b), data = BDD)


pgmm(credit ~ lag((credit), 1) + lag((sscb_res), 1), data = BDD, effect = "twoways", model = "twosteps")
pgmm(credit ~ lag((credit), 0:1) + lag((sscb_res), 0:1), data = BDD, effect = "twoways", model = "twosteps")

And so on. I don't know what to do. Do you think it comes from the high number of "0" in the data?

I followed this example:

data("EmplUK", package = "plm")
z1 <- pgmm(log(emp) ~ lag(log(emp), 1:2) + lag(log(wage), 0:1)
       + log(capital) + lag(log(output), 0:1) | lag(log(emp), 2:99),
       data = EmplUK, effect = "twoways", model = "twosteps")

However, I don't understand why there is "0:1" instead of "1" for one lag.

Can you help me please?

PS: Please excuse my english

Helix123
  • 3,502
  • 2
  • 16
  • 36
J.Martin
  • 41
  • 3

0 Answers0