# pgmm function issues

Hello Everyone, I am a last-year student at university, currently working on my Bachelor's (so still learning R), and I really hope that you would suggest a potential solution (even if to use Python).

I need to estimate this model by using the GMM (preferably Arellano and Bond (1991)). I have been searching for the solution for almost 2 months, yet still not succeeded.

The data set could be found here:

My code is the following:

PLVData_A <- pdata.frame(LVData_A, index = c("ID","Year"))

z1 <- pgmm(domegaACF_A ~ lag(domegaACF_A, 1) + ddebt + ff1 + ff1:ddebt + Age + ta + dsales | lag(domegaACF_A, 1:2),
data = PLVData_A, effect = "twoways", model = "onestep", transformation = "d")
summary(z1, robust = TRUE)

After I have created all the needed variables, I am trying to estimate coeffs by using pgmm function in plm package. And receive 3 types of errors:

In case I use transformation = "d" - 1 type 1 picture

In case I use transformation = "ld" , errors are as follows: 2 type of error - second picture
In case I delete lag from the model and put it after "|" sign I get: 3 type of error - third picture

I would really appreciate any comments and suggestions provided because I do not know how to get away from this dead end. Thank you in advance!)

Please ask for the data and any explanation, since I am really desperate to find the solution.

UPD: I have created lags as separate variables, so here is a new correlation matrix:

domegaACF_A        ddebt          ff1          Age          ta       dsales lag1_domegaACF_A lag2_domegaACF_A
domegaACF_A       1.000000000 -0.014777102 -0.002600866 -0.019160423  0.02456158  0.256801279     -0.379350157     -0.027687422
ddebt            -0.014777102  1.000000000  0.128264730  0.004706522  0.03878795  0.057488971      0.018800962     -0.003222902
ff1              -0.002600866  0.128264730  1.000000000 -0.048072279 -0.02868682  0.008979745     -0.002808377      0.008062733
Age              -0.019160423  0.004706522 -0.048072279  1.000000000  0.27884112 -0.021440539     -0.051829392     -0.048162046
ta                0.024561579  0.038787947 -0.028686815  0.278841116  1.00000000  0.078247618      0.015304990      0.015539599
dsales            0.256801279  0.057488971  0.008979745 -0.021440539  0.07824762  1.000000000     -0.049518811     -0.004134281
lag1_domegaACF_A -0.379350157  0.018800962 -0.002808377 -0.051829392  0.01530499 -0.049518811      1.000000000     -0.358671174
lag2_domegaACF_A -0.027687422 -0.003222902  0.008062733 -0.048162046  0.01553960 -0.004134281     -0.358671174      1.000000000

And I believe that correlation is not much trouble.