Announcement

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

  • I need to run first and Second stage by using 2SLS

    Dear Statalisters,

    I apply 2SLS to deal with/ address the heterogeneity concerns between competition (the Lerner index) and financial performance of our banks. For stage two of the 2SLS model we need to use the fitted values of Lerner index. How to generate these fitted values (that is, what command to use).

    Below you can find my approach to run first and second stage:

    I am using OLS regression for the first stage, where I put the lag for the instrumental variable lerner

    Code:
    regress roa l.lerner es escovid19 lernercovid19 institution customerdeposit_growth loan_asset noninterestincome size corporateloansgrowthrate luqidasset  equitytotalassets car gdp_growth inflation gcc_d d_iraq d_bahrain d_syrianarabrepublic d_palestinianterritories d_oman d_tunisia d_yemen d_saudiarabia d_jordan d_kuwait d_iran d_unitedarabemirates d_qatar d_lebanon d_egypt d_morocco d_libya d_algeria d_israel d_malta
    note: d_qatar omitted because of collinearity
    note: d_libya omitted because of collinearity
    
          Source |       SS       df       MS              Number of obs =    2589
    -------------+------------------------------           F( 34,  2554) =    5.95
           Model |   .44566372    34  .013107756           Prob > F      =  0.0000
        Residual |  5.62301178  2554  .002201649           R-squared     =  0.0734
    -------------+------------------------------           Adj R-squared =  0.0611
           Total |   6.0686755  2588  .002344929           Root MSE      =  .04692
    
    ------------------------------------------------------------------------------------------
                         roa |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    -------------------------+----------------------------------------------------------------
                      lerner |
                         L1. |  -.0095362   .0036298    -2.63   0.009    -.0166539   -.0024185
                             |
                          es |   .0060945   .0045187     1.35   0.178    -.0027662    .0149551
                   escovid19 |  -.0224527   .0062567    -3.59   0.000    -.0347215    -.010184
               lernercovid19 |   .0399304   .0073166     5.46   0.000     .0255834    .0542775
                 institution |   .0002905   .0014833     0.20   0.845    -.0026181     .003199
      customerdeposit_growth |   .0052759    .003515     1.50   0.133    -.0016167    .0121684
                  loan_asset |  -.0042449   .0035936    -1.18   0.238    -.0112916    .0028017
           noninterestincome |   .0421363   .0060258     6.99   0.000     .0303204    .0539522
                        size |  -.0001906   .0006648    -0.29   0.774    -.0014941     .001113
    corporateloansgrowthrate |   .0023772   .0037773     0.63   0.529    -.0050297     .009784
                  luqidasset |  -.0046013   .0038684    -1.19   0.234    -.0121868    .0029843
           equitytotalassets |   .0020457   .0039702     0.52   0.606    -.0057394    .0098308
                         car |   .0099154   .0049099     2.02   0.044     .0002876    .0195433
                  gdp_growth |  -.0176409   .0195054    -0.90   0.366     -.055889    .0206072
                   inflation |   .0049327   .0110903     0.44   0.657    -.0168141    .0266795
                       gcc_d |   .0121645   .0103575     1.17   0.240    -.0081455    .0324745
                      d_iraq |   .0017969   .0096179     0.19   0.852    -.0170628    .0206565
                   d_bahrain |  -.0178029   .0069053    -2.58   0.010    -.0313434   -.0042623
        d_syrianarabrepublic |   .0463541   .0097503     4.75   0.000     .0272347    .0654734
    d_palestinianterritories |   .0055617   .0106894     0.52   0.603     -.015399    .0265224
                      d_oman |   -.006375   .0072343    -0.88   0.378    -.0205607    .0078107
                   d_tunisia |   .0048229   .0091034     0.53   0.596    -.0130279    .0226737
                     d_yemen |   .0154679   .0135754     1.14   0.255     -.011152    .0420877
               d_saudiarabia |    .012205   .0075289     1.62   0.105    -.0025583    .0269683
                    d_jordan |   .0080886   .0092123     0.88   0.380    -.0099758     .026153
                    d_kuwait |  -.0069919   .0072173    -0.97   0.333    -.0211443    .0071605
                      d_iran |   .0086982   .0104401     0.83   0.405    -.0117737    .0291702
        d_unitedarabemirates |  -.0031995   .0070636    -0.45   0.651    -.0170504    .0106514
                     d_qatar |          0  (omitted)
                   d_lebanon |   .0042542   .0090399     0.47   0.638    -.0134721    .0219806
                     d_egypt |   .0109324   .0089617     1.22   0.223    -.0066406    .0285053
                   d_morocco |   .0037943     .00959     0.40   0.692    -.0150106    .0225993
                     d_libya |          0  (omitted)
                   d_algeria |   .0147692   .0097202     1.52   0.129    -.0042911    .0338295
                    d_israel |  -.0024029   .0102098    -0.24   0.814    -.0224233    .0176175
                     d_malta |   .0132458   .0099935     1.33   0.185    -.0063504     .032842
                       _cons |   .0036968   .0107959     0.34   0.732    -.0174728    .0248665
    ------------------------------------------------------------------------------------------
    Then I run 2SLS for the second stage by using ivreg2:

    Code:
    ivreg2 roa es escovid19 lernercovid19 institution customerdeposit_growth loan_asset noninterestincome size corporateloansgrowthrate luqidasset  equitytotalassets car gdp_growth inflation (lerner=l.lerner) gcc_d d_iraq d_bahrain d_syrianarabrepublic d_palestinianterritories d_oman d_tunisia d_yemen d_saudiarabia d_jordan d_kuwait d_iran d_unitedarabemirates d_qatar d_lebanon d_egypt d_morocco d_libya d_algeria d_israel d_malta, endog(lerner)
    Warning: time variable banks1 has 767 gap(s) in relevant range
    Warning - collinearities detected
    Vars dropped:       d_qatar d_malta
    
    IV (2SLS) estimation
    --------------------
    
    Estimates efficient for homoskedasticity only
    Statistics consistent for homoskedasticity only
    
                                                          Number of obs =     2589
                                                          F( 34,  2554) =     2.45
                                                          Prob > F      =   0.0000
    Total (centered) SS     =  6.068675495                Centered R2   =  -1.2526
    Total (uncentered) SS   =  6.511511255                Uncentered R2 =  -1.0994
    Residual SS             =  13.67057107                Root MSE      =   .07267
    
    ------------------------------------------------------------------------------------------
                         roa |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------------------+----------------------------------------------------------------
                      lerner |  -.6281187    .370259    -1.70   0.090    -1.353813    .0975757
                          es |   .0244415   .0129454     1.89   0.059     -.000931     .049814
                   escovid19 |   -.072539   .0311774    -2.33   0.020    -.1336456   -.0114324
               lernercovid19 |    .111369   .0433862     2.57   0.010     .0263337    .1964043
                 institution |   .0183552   .0108774     1.69   0.092    -.0029641    .0396745
      customerdeposit_growth |   .0162899   .0085851     1.90   0.058    -.0005367    .0331164
                  loan_asset |   .0016047   .0066657     0.24   0.810    -.0114598    .0146693
           noninterestincome |   .0451403   .0094402     4.78   0.000     .0266379    .0636427
                        size |   .0024808   .0018971     1.31   0.191    -.0012375    .0061992
    corporateloansgrowthrate |  -.0019177   .0063753    -0.30   0.764    -.0144131    .0105777
                  luqidasset |   .0012117   .0066995     0.18   0.856    -.0119191    .0143425
           equitytotalassets |   .0057079   .0065284     0.87   0.382    -.0070876    .0185034
                         car |    .014246    .007846     1.82   0.069    -.0011318    .0296238
                  gdp_growth |    .011363     .03522     0.32   0.747    -.0576669    .0803929
                   inflation |   .0594354   .0372514     1.60   0.111     -.013576    .1324468
                       gcc_d |   .2015531   .1194758     1.69   0.092    -.0326152    .4357213
                      d_iraq |   .4535345   .2741308     1.65   0.098     -.083752     .990821
                   d_bahrain |   .2642198   .1674414     1.58   0.115    -.0639593     .592399
        d_syrianarabrepublic |   .4578509   .2506158     1.83   0.068    -.0333471    .9490489
    d_palestinianterritories |   .2953741   .1792197     1.65   0.099      -.05589    .6466382
                      d_oman |   .0640446   .0428563     1.49   0.135    -.0199522    .1480413
                   d_tunisia |   .3094563   .1871647     1.65   0.098    -.0573797    .6762924
                     d_yemen |   .1987349   .1158293     1.72   0.086    -.0282864    .4257562
               d_saudiarabia |   -.132307     .08673    -1.53   0.127    -.3022947    .0376808
                    d_jordan |   .2289398   .1379655     1.66   0.097    -.0414677    .4993473
                    d_kuwait |   .2471417   .1505531     1.64   0.101    -.0479369    .5422204
                      d_iran |   .0848352   .0536981     1.58   0.114    -.0204112    .1900816
        d_unitedarabemirates |   .0146991   .0151549     0.97   0.332     -.015004    .0444022
                     d_qatar |          0  (omitted)
                   d_lebanon |   .5465863   .3271319     1.67   0.095    -.0945803    1.187753
                     d_egypt |   .4988974   .2950886     1.69   0.091    -.0794656     1.07726
                   d_morocco |   .3185791   .1928848     1.65   0.099    -.0594682    .6966264
                     d_libya |  -.0047826   .0163956    -0.29   0.771    -.0369174    .0273522
                   d_algeria |   .2218783   .1297559     1.71   0.087    -.0324386    .4761953
                    d_israel |   .4710253   .2863757     1.64   0.100    -.0902607    1.032311
                     d_malta |          0  (omitted)
                       _cons |  -.0379773   .0317201    -1.20   0.231    -.1001476     .024193
    ------------------------------------------------------------------------------------------
    Underidentification test (Anderson canon. corr. LM statistic):           5.202
                                                       Chi-sq(1) P-val =    0.0226
    ------------------------------------------------------------------------------
    Weak identification test (Cragg-Donald Wald F statistic):                5.142
    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.
    ------------------------------------------------------------------------------
    Sargan statistic (overidentification test of all instruments):           0.000
                                                     (equation exactly identified)
    -endog- option:
    Endogeneity test of endogenous regressors:                               7.442
                                                       Chi-sq(1) P-val =    0.0064
    Regressors tested:    lerner
    ------------------------------------------------------------------------------
    Instrumented:         lerner
    Included instruments: es escovid19 lernercovid19 institution
                          customerdeposit_growth loan_asset noninterestincome size
                          corporateloansgrowthrate luqidasset equitytotalassets car
                          gdp_growth inflation gcc_d d_iraq d_bahrain
                          d_syrianarabrepublic d_palestinianterritories d_oman
                          d_tunisia d_yemen d_saudiarabia d_jordan d_kuwait d_iran
                          d_unitedarabemirates d_lebanon d_egypt d_morocco d_libya
                          d_algeria d_israel
    Excluded instruments: L.lerner
    Dropped collinear:    d_qatar d_malta
    ------------------------------------------------------------------------------
    
    .
    Will appreciate if you can tell me whether this is the right way to generate the so-called fitted value or I have to use
    Code:
    ivreg y (x1 = z1 z2) x2, first
    Thank you in advance for the help!

    Petko Bachvarov
    Last edited by Petko Bachvarov; 11 Oct 2023, 09:19.

  • #2
    ivreg2 uses the fitted value from stage 1 in stage 2, and that fit is based on the X + l.lerner (which is a weak instrument).

    add first as an option to get the first-stage results (rather than using regress).

    Comment


    • #3
      Dear George Ford,

      Thank you very much for the guidance on that.

      Petko

      Comment

      Working...
      X