Announcement

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

  • XTIVREG, FE: needs to be FE in stage 1 and 2?

    Hi all,

    I'm running a fixed effects regression using an IV variable, but I'm wondering, do I need to have fixed effects in both stage 1 and stage 2? I see that fixed effects are automatically applied to both stages, but I'm not sure why. If I use fixed effects in stage 2, why do I need them in stage 1?

  • #2
    Yes, you implement fixed effects estimation in both stages. If you are estimating a linear fixed effects IV regression, you are acknowledging from the get go that you have an endogenous covariate after taking into account unobserved heterogeneity. The two-stage least squares (2SLS) procedure does not change, except that with xtivreg,fe you are using the within-transformation to purge the fixed effects. Computing resources allowing, you could estimate the same model using 2SLSDV (2SLS Dummy Variables), treating the indicators the same as other exogenous covariates in the model. Example:

    Code:
    webuse nlswork, clear
    keep if id<1001
    xtivreg ln_w age c.age#c.age not_smsa (tenure = union south), fe
    qui regress tenure union south age c.age#c.age not_smsa i.id
    predict tenurehat, xb
    *STANDARD ERRORS NOT CORRECTED TO ACCOUNT FOR 2 STAGE ESTIMATION
    regress ln_w tenurehat age c.age#c.age not_smsa i.id if e(sample)

    Res.:

    Code:
    . xtivreg ln_w age c.age#c.age not_smsa (tenure = union south), fe
    
    Fixed-effects (within) IV regression            Number of obs     =      3,628
    Group variable: idcode                          Number of groups  =        788
    
    R-sq:                                           Obs per group:
         within  =      .                                         min =          1
         between = 0.1351                                         avg =        4.6
         overall = 0.0884                                         max =         12
    
                                                    Wald chi2(4)      =  123241.51
    corr(u_i, Xb)  = -0.2956                        Prob > chi2       =     0.0000
    
    ------------------------------------------------------------------------------
         ln_wage |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
          tenure |   .0831503   .0251388     3.31   0.001     .0338791    .1324215
             age |  -.0172163   .0116592    -1.48   0.140    -.0400679    .0056352
                 |
     c.age#c.age |   .0000577   .0001561     0.37   0.712    -.0002482    .0003636
                 |
        not_smsa |  -.1124299   .0419959    -2.68   0.007    -.1947403   -.0301194
           _cons |   2.041464   .1967391    10.38   0.000     1.655862    2.427065
    -------------+----------------------------------------------------------------
         sigma_u |  .39408745
         sigma_e |  .32103669
             rho |  .60109624   (fraction of variance due to u_i)
    ------------------------------------------------------------------------------
    F  test that all u_i=0:     F(787,2836) =     5.45        Prob > F    = 0.0000
    ------------------------------------------------------------------------------
    Instrumented:   tenure
    Instruments:    age c.age#c.age not_smsa union south
    ------------------------------------------------------------------------------
    
    .
    . qui regress tenure union south age c.age#c.age not_smsa i.id
    
    .
    . predict tenurehat, xb
    (1,727 missing values generated)
    
    . *STANDARD ERRORS NOT CORRECTED TO ACCOUNT FOR 2 STAGE ESTIMATION
    
    . regress ln_w tenurehat age c.age#c.age not_smsa i.id if e(sample)
    
          Source |       SS           df       MS      Number of obs   =     3,628
    -------------+----------------------------------   F(791, 2836)    =      8.46
           Model |  530.909106       791  .671187239   Prob > F        =    0.0000
        Residual |  224.881826     2,836  .079295425   R-squared       =    0.7025
    -------------+----------------------------------   Adj R-squared   =    0.6195
           Total |  755.790932     3,627  .208379082   Root MSE        =    .28159
    
    ------------------------------------------------------------------------------
         ln_wage |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
       tenurehat |   .0831503   .0220503     3.77   0.000     .0399141    .1263865
             age |  -.0172163   .0102267    -1.68   0.092    -.0372689    .0028363
                 |
     c.age#c.age |   .0000577   .0001369     0.42   0.674    -.0002108    .0003261
                 |
        not_smsa |  -.1124299   .0368363    -3.05   0.002    -.1846586   -.0402011
                 |
          idcode |
              2  |  -.7169029   .1502458    -4.77   0.000    -1.011505   -.4223009
              3  |  -.8224951    .141336    -5.82   0.000    -1.099627   -.5453634
              4  |  -.2941909   .1449831    -2.03   0.043    -.5784739   -.0099078
              5  |  -.3717034    .150526    -2.47   0.014    -.6668548    -.076552
              6  |  -.9386166   .1872215    -5.01   0.000    -1.305721   -.5715126
              7  |  -1.049759   .1664632    -6.31   0.000     -1.37616   -.7233573
              .
              .
              .
            999  |  -.5159653    .179016    -2.88   0.004      -.86698   -.1649506
           1000  |  -.8508873    .169171    -5.03   0.000    -1.182598   -.5191768
                 |
           _cons |   2.548984   .2208364    11.54   0.000     2.115968       2.982
    ------------------------------------------------------------------------------
    Last edited by Andrew Musau; 29 Jan 2021, 06:28.

    Comment


    • #3
      Andrew, thank you (as always)! This makes perfect sense.

      Comment


      • #4
        Hello All,

        I need an urgent clarification with the IV-2SLS approach by “xtivreg2”. I am unable to understand how this has been implemented in the presence of interaction terms of an endogenous variable. Please direct me to some reference which can help me in learning more about such models that include quadratic and interaction terms of an endogenous variable. Meanwhile the model that I use is:

        Performance = F(Leverage, Leverage_Square, Leverage*HHI, Leverage*Size, Size, Size_Square ,Growth,HHI)
        Here Leverage is endogenous that is instrumented using Tangibility of Assets. I use the following code;

        Code:
         I: xtivreg2 ROTA (l.Leverage l.Leverage_Square l.Lev*HHI l.Lev*Size =  l.Tangibility l.Tangibility_Square l.Tangibility*HHI l.Tangibility*Size)  l.HHI l.Size  l.Size_Square l.Growth, fe endog (l.Leverage l.Leverage_Square l.Lev*HHI l.Lev*Size)
        Model II: Without Square Term but in presence of Interaction Terms (and different placement of interaction terms)
        Code:
         II: xtivreg2 ROTA (l.Leverage =  l.Tangibility) l.Lev*HHI l.Lev*Size  l.HHI l.Size  l.Size_Square l.Growth, fe (l.Leverage)
        Do we have to mention the robust option while performing xtivreg2 as I read if we have already set the data to be panel, it does clustering at the firm level. Also, whether I have rightly placed the interaction terms? While I am doing it the above way, I do not get the Cragg-Donald statistic (although Kleibergen-Paap rk Wald F statistic is visible).

        What am I missing here? I tried almost every permutation combination still not sure if I am doing or even heading towards the right direction. If needed I would show the exact model but here I have deliberately kept it short so as to convey my specific doubt.

        Please help!

        Any paper suggestions that elaborates on the above issue.

        regards,
        Mohina

        Comment


        • #5
          mohina saxena, you should start a new thread so that your question gets the attention that it deserves.

          I: xtivreg2 ROTA (l.Leverage l.Leverage_Square l.Lev*HHI l.Lev*Size = l.Tangibility l.Tangibility_Square l.Tangibility*HHI l.Tangibility*Size) l.HHI l.Size l.Size_Square l.Growth, fe endog (l.Leverage l.Leverage_Square l.Lev*HHI l.Lev*Size)
          II: xtivreg2 ROTA (l.Leverage = l.Tangibility) l.Lev*HHI l.Lev*Size l.HHI l.Size l.Size_Square l.Growth, fe (l.Leverage)
          For models 1 and 2, any variable outside the parenthesis is considered exogenous, so I believe that inclusion of an interacted endogenous variable as an exogenous variable (#2) is not appropriate. #1 looks fine.


          Do we have to mention the robust option while performing xtivreg2 as I read if we have already set the data to be panel, it does clustering at the firm level.
          No, there is no default clustering. You have to specify this explicitly as an option -cluster(firm)-.


          Please direct me to some reference which can help me in learning more about such models that include quadratic and interaction terms of an endogenous variable.
          Look at Chapter 8 of Econometric Analysis of Cross Section and Panel Data, 2nd Edition by Jeff Wooldridge.
          Last edited by Andrew Musau; 10 Feb 2021, 06:47.

          Comment


          • #6
            Many Thanks Andrew for the clarifications.

            Comment

            Working...
            X