Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Question about 3-way interactions in GMM estimation (xtabond2)

    Hello everyone, thank you for taking the time to read my post.

    I have a question about running panel GMM, and I am using STATA 17 for this purpose.

    Let me provide a brief overview of my dataset:
    • Y: dependent variable - measured weekly
    • X1: endogenous variable – measured weekly
    • X2: endogenous variable – measured weekly
    • X3: exogenous variable – measured yearly
    • X4: exogenous control variable – measured yearly
    X1, X2, and X3 are the key variables while X4 is used as a control variable.
    Below is an example of my dataset.

    Click image for larger version

Name:	data.PNG
Views:	1
Size:	52.0 KB
ID:	1733143



    Now, in addition to the 2-way interactions (X1, X2), I also have 3-way interactions (X1, X2, and X3) as follows:
    • X1*X2
    • X1*X3
    • X1*X2*X3
    My main question revolves around what should be included in the gmmstyle() and ivstyle() functions. As far as I understand, I should place L.y and endogenous variables inside gmmstyle(), and exogenous variables inside ivstyle().

    However, a challenge arises due to the fact that X3 is a yearly variable, making it time-invariant for at least for each year. Consequently, taking first differences will lead to its elimination.

    Here is what I have attempted so far, but I believe it is incorrect

    (1) Dynamic GMM

    Code:
     xtabond2 y l.y x1 x2 x3 c.x1#c.x2 c.x1#c.x3 c.x1#c.x2#c.x3 x4, gmm(l.y x1 x2 c.x1#c.x2 c.x1#c.x2#c.x3) iv(x3 x4, equation(level)) noleveleq
    Q1. Although x3 is exogenous, interactions with endogenous variables are included in gmm(). What would happen to the x1*x3 and x1*x2*x3? Will they be eliminated because x3 is first differenced?, or is it acceptable since I have placed x3 in the iv()? I am unsure about the correct approach here.

    (2) System GMM

    Code:
     xtabond2 y l.y x1 x2 x3 c.x1#c.x2 c.x1#c.x3 c.x1#c.x2#c.x3 x4, gmm(l.y x1 x2 c.x1#c.x2 c.x1#c.x2#c.x3) iv(x3 x4, equation(level))
    Q2. In system GMM, we use level data and the first differenced variables as instruments. So, I guess x1*x3 and x1*x2*x3 will not be eliminated this time, but what about x3 as an instrument? first differencing x3 will eliminate x3. Should I remove c.x1#c.x2#c.x3 inside gmm()? Likewise, I want to know the correct approach.


    Thank you in advance.



  • #2
    A few comments:
    • It is a common misunderstanding that endogenous variables should be placed into gmm() and exogenous variables into iv(). The latter is just a collapsed version of the former. Rather than distinguishing between those two options, emphasis needs to be put on choosing the correct lag orders for the instruments and the relevant transformations of the model and variables. Another common issue is that the term "exogenous" is often not clearly defined. If you use those instruments for the level model without any transformation, then those variables need to be exogenous not just with respect to the idiosyncratic error component but also with respect to the time-invariant group-specific error component. This is akin to a "random-effects" assumption, which is often too strong to be justifiable.
    • I do not recommend to use the default setting of xtabond2 unless you are 100% sure of what they are. Instead, I recommend to explicitly specifiy all suboptions, so that you can be sure that you get what you want. If you find the xtabond2 syntax confusing, my xtdpdgmm command might possibly be a suitable alternative with a more intuitive syntax.
    • D.(c.x1#c.x2#c.x3) does not mean cD.x1#cD.x2#cD.x3. In other words, even if x3 is time invariant, as long as the interaction term varies over time, its difference will not vanish.
    Further information:
    https://www.kripfganz.de/stata/

    Comment

    Working...
    X