ycroissant / plm

Panel Data Econometrics with R
GNU General Public License v2.0
50 stars 13 forks source link

External instruments in pgmm() #40

Open Jullek23 opened 1 year ago

Jullek23 commented 1 year ago

Hi there,

my question is about using external, "IV-like" Instruments in pgmm(). Is such a feature implemented?

For example:

`mod <- pgmm(w ~ lag(w, 1) + lag(k,1) lag(w, 2:99)
          lag(k,1)
        ,
        effect = "twoways",
        model = "twostep",
        data = data)`

Lets say I want to instrument "k" with an external instrument "d" that is uncorrelated with the idiosyncratic error term. Is it possible to do this with pgmm(), and if so, is it done in the same way as in plm()?:

`mod <- pgmm(w ~ lag(w, 1) + lag(k,1) lag(w, 2:99)
          lag(d,1)
        ,
        effect = "twoways",
        model = "twostep",
        data = data)`

Thank you very much in advance and I hope the question is not out of place here. I have tried to find a solution in "Panel data econometrics in R", the Vignette of "plm" and "stackoverflow", but was not successful. Hopefully I have not missed an obvious answer ...

Best, Julian

kmfrick commented 1 month ago

from est_gmm.R lines 237-241:

  # Three possibilities for 'normal' instruments :
  # 1. the third part of the formula describes them
  # 2. all variables not used as gmm are normal instruments
  # 3. all variables are gmm instruments and therefore, there are no
  #    normal instruments except maybe time dummies