Announcement

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

  • Instrumenting an Endogenous Moderator with Interactions in ivreghdfe

    Dear Statalist, I am using a panel data of firms to study how some sectoral characteristics affect the performance of the firm, and how a firm characteristic may moderate this effect. I am using a FE model “reghdfe” in which x1 is the firm-level moderator and z1 and z2 are the main sectoral variables. The rest (x2, x3 and z3) are firm and sectoral controls, with FEs for year and firm, and standard errors clustered at sectoral level (30 groups).
    Code:
    . reghdfe y L.c.x2 L.c.x3 L.c.x1##(L.c.z1 L.c.z2) L.c.z3 if sample==1, absorb(year id) cluster(sec)
    (dropped 524 singleton observations)
    (MWFE estimator converged in 7 iterations)
    
    HDFE Linear regression                            Number of obs   =     55,339
    Absorbing 2 HDFE groups                           F(   8,     29) =      53.29
    Statistics robust to heteroskedasticity           Prob > F        =     0.0000
                                                      R-squared       =     0.5454
                                                      Adj R-squared   =     0.4716
                                                      Within R-sq.    =     0.0101
    Number of clusters (sec)     =         30         Root MSE        =     4.8275
    
                                       (Std. Err. adjusted for 30 clusters in sec)
    ------------------------------------------------------------------------------
                 |               Robust
               y |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
              x2 |
             L1. |   .9385646   .0990022     9.48   0.000     .7360824    1.141047
                 |
              x3 |
             L1. |   .0106796   .0009048    11.80   0.000      .008829    .0125301
                 |
              x1 |
             L1. |   .0191061   .0169623     1.13   0.269    -.0155858    .0537979
                 |
              z1 |
             L1. |   .2640843   .1633937     1.62   0.117    -.0700933     .598262
                 |
              z2 |
             L1. |   .3761676   .1096724     3.43   0.002     .1518622    .6004729
                 |
     cL.x1#cL.z1 |   .0952601     .03201     2.98   0.006     .0297923    .1607279
                 |
     cL.x1#cL.z2 |  -.0596345   .0431216    -1.38   0.177    -.1478281    .0285592
                 |
              z3 |
             L1. |   .1472666   .2668953     0.55   0.585    -.3985957    .6931289
                 |
           _cons |   3.682327   .0661808    55.64   0.000     3.546972    3.817682
    ------------------------------------------------------------------------------
    
    Absorbed degrees of freedom:
    -----------------------------------------------------+
     Absorbed FE | Categories  - Redundant  = Num. Coefs |
    -------------+---------------------------------------|
            year |        11           1          10     |
              id |      7706        7706           0    *|
    -----------------------------------------------------+
    However, the moderator (x1) is likely to be endogenous. And I would like to check if lagged values of the moderator may be used as instruments. I am trying to adapt the previous regression to the command “ivreghdfe”. Without the interaction all works, but I need the same specification as with “reghdfe” shown before. When including the ## for the interaction, it gives error.
    Code:
    . ivreghdfe y L.c.x2 L.c.x3 (L.c.x1 = L2.c.x1 L3.c.x1)##L.c.z1 L.c.z2 L.c.z3 if sample==1, absorb(yea
    > r id) cluster(sec)
    # invalid name
    r(198);
    Can anyone help me understand what am I doing wrong?

    A secondary question is about the structure of the FEs. I mean, I have firm FE, year FE, and cluster errors at sectoral level. But I have seen some papers with the same data structure but with a different FEs, that is: sectoral FE, year FE, standard errors clustered at firm level. How to know which one is the best?
Working...
X