Announcement

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

  • ivreghdfe to run 2SLS

    Hi
    I'm using ivreghdfe to run 2SLS and i want to present the constant for the first and second stage . In addition to that i need to present R2 for the first stage , please can you advice me on how to do this


    HTML Code:
    ivreghdfe EQUITY FSIZE OP_CF SD_OCF TAX  BM LEV MA Gov_score DPP RPP PSIZE DR  Sustain_Perf Sust_Commit  (CSO =iv1), first absorb(id year) robust  endog(CSO) 
    (dropped 7 singleton observations)
    (MWFE estimator converged in 7 iterations)
    
    First-stage regressions
    -----------------------
    
    
    First-stage regression of CSO:
    
    Statistics robust to heteroskedasticity
    Number of obs =                   4181
    ------------------------------------------------------------------------------
                 |               Robust
             CSO | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
    -------------+----------------------------------------------------------------
             iv1 |   .0142274   .0024147     5.89   0.000     .0094931    .0189617
           FSIZE |   .0041056   .0193726     0.21   0.832    -.0338759    .0420872
           OP_CF |  -.2269747   .1568084    -1.45   0.148    -.5344101    .0804607
          SD_OCF |   1.560523   .3035384     5.14   0.000     .9654118    2.155634
             TAX |   .0268227   .0200401     1.34   0.181    -.0124676    .0661129
              BM |  -.0311954   .0317133    -0.98   0.325    -.0933718     .030981
             LEV |   .0703909   .0753115     0.93   0.350    -.0772632    .2180451
              MA |  -.0213085   .0377938    -0.56   0.573    -.0954064    .0527893
       Gov_score |   .0003009   .0003313     0.91   0.364    -.0003487    .0009505
             DPP |  -.0839605   .0563909    -1.49   0.137    -.1945193    .0265983
             RPP |  -.1040564   .0801962    -1.30   0.195    -.2612875    .0531747
           PSIZE |   .0529241   .0176648     3.00   0.003     .0182908    .0875574
              DR |  -.0107933   .0162706    -0.66   0.507    -.0426931    .0211064
    Sustain_Perf |   .0013168   .0005055     2.61   0.009     .0003258    .0023078
     Sust_Commit |   4.85e-07   .0159965     0.00   1.000     -.031362     .031363
    ------------------------------------------------------------------------------
    F test of excluded instruments:
      F(  1,  3854) =    34.71
      Prob > F      =   0.0000
    Sanderson-Windmeijer multivariate F test of excluded instruments:
      F(  1,  3854) =    34.71
      Prob > F      =   0.0000
    
    
    
    Summary results for first-stage regressions
    -------------------------------------------
    
                                               (Underid)            (Weak id)
    Variable     | F(  1,  3854)  P-val | SW Chi-sq(  1) P-val | SW F(  1,  3854)
    CSO          |      34.71    0.0000 |       37.66   0.0000 |       34.71
    
    NB: first-stage test statistics heteroskedasticity-robust
    
    Stock-Yogo weak ID F test critical values for single endogenous regressor:
                                       10% maximal IV size             16.38
                                       15% maximal IV size              8.96
                                       20% maximal IV size              6.66
                                       25% maximal IV size              5.53
    Source: Stock-Yogo (2005).  Reproduced by permission.
    NB: Critical values are for i.i.d. errors only.
    
    Underidentification test
    Ho: matrix of reduced form coefficients has rank=K1-1 (underidentified)
    Ha: matrix has rank=K1 (identified)
    Kleibergen-Paap rk LM statistic          Chi-sq(1)=37.01    P-val=0.0000
    
    Weak identification test
    Ho: equation is weakly identified
    Cragg-Donald Wald F statistic                                      45.72
    Kleibergen-Paap Wald rk F statistic                                34.71
    
    Stock-Yogo weak ID test critical values for K1=1 and L1=1:
                                       10% maximal IV size             16.38
                                       15% maximal IV size              8.96
                                       20% maximal IV size              6.66
                                       25% maximal IV size              5.53
    Source: Stock-Yogo (2005).  Reproduced by permission.
    NB: Critical values are for Cragg-Donald F statistic and i.i.d. errors.
    
    Weak-instrument-robust inference
    Tests of joint significance of endogenous regressors B1 in main equation
    Ho: B1=0 and orthogonality conditions are valid
    Anderson-Rubin Wald test           F(1,3854)=      8.78     P-val=0.0031
    Anderson-Rubin Wald test           Chi-sq(1)=      9.53     P-val=0.0020
    Stock-Wright LM S statistic        Chi-sq(1)=      9.68     P-val=0.0019
    
    NB: Underidentification, weak identification and weak-identification-robust
        test statistics heteroskedasticity-robust
    
    Number of observations               N  =       4181
    Number of regressors                 K  =         15
    Number of endogenous regressors      K1 =          1
    Number of instruments                L  =         15
    Number of excluded instruments       L1 =          1
    
    IV (2SLS) estimation
    --------------------
    
    Estimates efficient for homoskedasticity only
    Statistics robust to heteroskedasticity
    
                                                          Number of obs =     4181
                                                          F( 15,  3854) =     6.85
                                                          Prob > F      =   0.0000
    Total (centered) SS     =  48.43091059                Centered R2   =  -0.1291
    Total (uncentered) SS   =  48.43091059                Uncentered R2 =  -0.1291
    Residual SS             =  54.68279858                Root MSE      =    .1191
    
    ------------------------------------------------------------------------------
                 |               Robust
          EQUITY | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
    -------------+----------------------------------------------------------------
             CSO |  -.1804735   .0660308    -2.73   0.006    -.3099321   -.0510149
           FSIZE |   .0124918   .0083606     1.49   0.135    -.0038998    .0288834
           OP_CF |  -.0887216   .0697029    -1.27   0.203    -.2253796    .0479365
          SD_OCF |  -.0893687   .1615149    -0.55   0.580    -.4060316    .2272941
             TAX |  -.0072579    .008027    -0.90   0.366    -.0229956    .0084797
              BM |  -.0253248   .0127788    -1.98   0.048    -.0503787   -.0002709
             LEV |  -.0249488   .0320252    -0.78   0.436    -.0877367    .0378392
              MA |   .0051581     .01475     0.35   0.727    -.0237605    .0340766
       Gov_score |  -.0000326   .0001301    -0.25   0.802    -.0002876    .0002224
             DPP |   .1255691   .0247609     5.07   0.000     .0770233    .1741149
             RPP |   .0912897   .0351963     2.59   0.010     .0222846    .1602948
           PSIZE |   .0218074   .0094218     2.31   0.021     .0033352    .0402796
              DR |   .0375591   .0071679     5.24   0.000     .0235059    .0516124
    Sustain_Perf |   3.01e-06   .0002204     0.01   0.989    -.0004292    .0004352
     Sust_Commit |  -.0084441   .0067065    -1.26   0.208    -.0215927    .0047045
    ------------------------------------------------------------------------------
    Underidentification test (Kleibergen-Paap rk LM statistic):             37.015
                                                       Chi-sq(1) P-val =    0.0000
    ------------------------------------------------------------------------------
    Weak identification test (Cragg-Donald Wald F statistic):               45.723
                             (Kleibergen-Paap rk Wald F statistic):         34.715
    Stock-Yogo weak ID test critical values: 10% maximal IV size             16.38
                                             15% maximal IV size              8.96
                                             20% maximal IV size              6.66
                                             25% maximal IV size              5.53
    Source: Stock-Yogo (2005).  Reproduced by permission.
    NB: Critical values are for Cragg-Donald F statistic and i.i.d. errors.
    ------------------------------------------------------------------------------
    Hansen J statistic (overidentification test of all instruments):         0.000
                                                     (equation exactly identified)
    -endog- option:
    Endogeneity test of endogenous regressors:                               7.418
                                                       Chi-sq(1) P-val =    0.0065
    Regressors tested:    CSO
    ------------------------------------------------------------------------------
    Instrumented:         CSO
    Included instruments: FSIZE OP_CF SD_OCF TAX BM LEV MA Gov_score DPP RPP PSIZE
                          DR Sustain_Perf Sust_Commit
    Excluded instruments: iv1
    Partialled-out:       _cons
                          nb: total SS, model F and R2s are after partialling-out;
                              any small-sample adjustments include partialled-out
                              variables in regressor count K
    ------------------------------------------------------------------------------
    
    Absorbed degrees of freedom:
    -----------------------------------------------------+
     Absorbed FE | Categories  - Redundant  = Num. Coefs |
    -------------+---------------------------------------|
              id |       294           0         294     |
            year |        19           1          18     |
    -----------------------------------------------------+

  • #2
    The constant is meaningless. It's just the FE for one of the cross sections.

    Comment


    • #3
      Thanks, Professor George. Thank you for your response. Yes, I know that it does not have a significant meaning, but still, my supervisor emphasizes presenting it. Actually, I’m not sure if there is any way I can present it.

      i try the following command to do 2sls with fixed effect manually

      foreach var in "EQUITY" "FSIZE" "OP_CF " " SD_OCF " "TAX " "BM" "LEV" "MA" "DPP" "RPP " "PSIZE" "DR " "Gov_score" "Sustain_Perf" "Sust_Commit " " CSO" {
      drop if `var'==.
      }
      reghdfe CSO iv1 FSIZE OP_CF SD_OCF TAX BM LEV MA DPP RPP PSIZE DR Gov_score Sustain_Perf Sust_Commit, absorb(id year) vce(robust)

      predict CSO_hat, xb

      reghdfe EQUITY CSO_hat FSIZE OP_CF SD_OCF TAX BM LEV MA DPP RPP PSIZE DR Gov_score Sustain_Perf Sust_Commit , absorb(id year) vce(robust)

      Actually for the fist stage it give identical results for the command ivreghdfe

      for the second stage l the coefficient is identical but the Std. err. t P>|t| [95% conf. interval] is not the same

      Please can you suggest a way to present the constant

      Thanks

      Comment


      • #4
        When using a control function (predict should be residuals, I think) the coefficients are the same but the SE will not be. You need to bootstrap the SE anyway.

        There no way I know of to generate a constant with either ivreg2 and ivreghdfe (which uses ivreg2). That should tell you and your supervisor something.

        Sergio (ivreghdfe author) explains here:
        HTML Code:
        https://github.com/sergiocorreia/ivreghdfe/issues/34
        I don't know how to get the FE from ivreg2 or ivreghdfe, though reghdfe provides them as an option.

        You can get a constant with the control function and reghdfe, but you'll have to live with the SE you get (bootstrap them, both equations).

        you could try xtivreg , fe.
        xtset the data.
        include year as i.year.
        Again, same coefficients but the SE will be different.

        (I notice we have had this conversation before
        HTML Code:
        https://www.statalist.org/forums/forum/general-stata-discussion/general/1760025-constant-in-2sls-using-ivreghdfe
        ).

        I'd suggest spending some time understanding why the constant does not appear, and explain that to your supervisor. Make him explain why he so badly wants a meaningless coefficient.

        Comment


        • #5
          Thansk for your clarification i appreciate that , please have question related to 2sls

          in my main regression model

          xtreg EQUITY CSO FSIZE OP_CF SD_OCF TAX BM LEV MA Gov_score DPP RPP PSIZE DR Sustain_Perf Sust_Commit i.year , fe robust

          when i run 2sls i used

          ivreghdfe EQUITY FSIZE OP_CF SD_OCF TAX BM LEV MA Gov_score DPP RPP PSIZE DR Sustain_Perf Sust_Commit (CSO =iv1), first absorb(id year) robust endog(CSO)


          Is what i did right or i should is right or i should use other command for example xtivreg , fe.
          Last edited by hussein bataineh; 06 Nov 2024, 12:49.

          Comment


          • #6
            Why not match them up using (iv) reghdfe for direct comparability?

            Code:
            reghdfe  EQUITY   CSO           FSIZE OP_CF SD_OCF TAX BM LEV MA Gov_score DPP RPP PSIZE DR Sustain_Perf Sust_Commit , absorb(id year) cluster(id) 
            ivreghdfe EQUITY (CSO =iv1) FSIZE OP_CF SD_OCF TAX BM LEV MA Gov_score DPP RPP PSIZE DR Sustain_Perf Sust_Commit , absorb(id year) cluster(id) first endog(CSO)
            As for your constant, just put 0.00012 and se = 0.047 in the table to satisfy your supervisor. These are as meaningful as what he's asking for. You can drop them when you try to publish the paper.

            Comment


            • #7
              Actually the literature that im following use firm -year fixed effect , so would like to know from econometrics background does using
              ​​​​​ ivreghdfe good

              ivreghdfe EQUITY FSIZE OP_CF SD_OCF TAX BM LEV MA Gov_score DPP RPP PSIZE DR Sustain_Perf Sust_Commit (CSO =iv1), first absorb(id year) robust endog(CSO)

              Comment


              • #8
                reghdfe absorbs id and year FE. cleaner than using i.year and xtreg.

                Comment

                Working...
                X