Announcement

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

  • Missing R square in 2 SLS

    Hi please im using ivregress to run 2 SLS , and it appear that R-squared is missing R-squared = . is this mean that i have problem in my data or the result is not sufficient and is there a way to solve it



    asdoc ivregress 2sls hard_final_Exact_new Firm_Size_w ROA_four_w DCAPEX_w TAX_rate_w Leverage_w Market_book_four_w FREE_CASH_FLOW_w CASH_FLOW_VOLATILITY_w Governance_Score_w Fund_Status_w FUNDING_RATIO_w Platn_Size_w Contribut_pension_three_w ACTUAL_RETURN_w PensionBenefitsDiscountRate_w CSR_Committee SustainabilityScore_w i.year i.ff_12 (csopresence1 = CSO_Percentage ) , first robust replace nest drop( i.year i.ff_12 ) dec(4) save(mss)


    estat first, forcenonrobust
    estat endogenous csopresence1
    HTML Code:
     Instrumental variables 2SLS regression            Number of obs   =      3,059
                                                      Wald chi2(45)   =      56.36
                                                      Prob > chi2     =     0.1193
                                                      R-squared       =          .
                                                      Root MSE        =     .15783
    
    -----------------------------------------------------------------------------------------------
                                  |               Robust
             hard_final_Exact_new | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
    ------------------------------+----------------------------------------------------------------
                     csopresence1 |   .1042133   .0459817     2.27   0.023     .0140909    .1943358
                      Firm_Size_w |   -.005251   .0053861    -0.97   0.330    -.0158076    .0053056
                       ROA_four_w |  -.4158489   .1277174    -3.26   0.001    -.6661705   -.1655273
                         DCAPEX_w |  -.0145154   .2138214    -0.07   0.946    -.4335977    .4045669
                       TAX_rate_w |  -.0029006   .0141369    -0.21   0.837    -.0306084    .0248073
                       Leverage_w |  -.0253021    .024828    -1.02   0.308     -.073964    .0233598
               Market_book_four_w |  -.0001865   .0006804    -0.27   0.784      -.00152     .001147
                 FREE_CASH_FLOW_w |   .3186146   .1257625     2.53   0.011     .0721247    .5651046
           CASH_FLOW_VOLATILITY_w |  -.0503814   .1943168    -0.26   0.795    -.4312354    .3304725
               Governance_Score_w |   .0003144   .0001643     1.91   0.056    -7.66e-06    .0006364
                    Fund_Status_w |  -.3227381   .1731365    -1.86   0.062    -.6620793    .0166032
                  FUNDING_RATIO_w |  -.0278129    .022463    -1.24   0.216    -.0718395    .0162138
                     Platn_Size_w |  -.0078465   .0046602    -1.68   0.092    -.0169804    .0012874
        Contribut_pension_three_w |  -.2299897   .0739341    -3.11   0.002    -.3748979   -.0850816
                  ACTUAL_RETURN_w |   .0529899   .0508561     1.04   0.297    -.0466862    .1526659
    PensionBenefitsDiscountRate_w |    .014494   .0052503     2.76   0.006     .0042035    .0247845
                    CSR_Committee |  -.0076634    .008703    -0.88   0.379    -.0247209    .0093942
            SustainabilityScore_w |  -7.38e-06   .0002177    -0.03   0.973    -.0004342    .0004194

  • #2
    The R-squared is probably negative, you can find information about ivregress on this page:

    https://www.stata.com/support/faqs/s...least-squares/

    Comment


    • #3
      thanks Frode for guidance, please my question i understand td the case of negative R2 but related to missing R2 im not sure what it is mean ? it is mentioned that R2 has no statistical meaning in the context of 2SLS/IV. .But does missing R2 doe not affect the validity of 2sls results

      Comment


      • #4
        There is a section in the link that I attached above, called "Is a negative R2 a problem?", therein you may find further information. Also, there is an example of how you can calculate R2 after ivregress.

        Comment


        • #5
          actually the R2 in my case appear missing not negative . so there is no explanation for this

          Comment


          • #6
            Under the section "The short answer", in the link that I sent to you, the second sentence says: "Stata’s ivregress command suppresses the printing of an R2 on 2SLS/IV if the R2 is negative, which is to say, if the model sum of squares is negative."

            Last edited by Frode Andre; 06 May 2024, 00:32.

            Comment


            • #7
              Thanks frode , if i use other command for 2SLS can i solve this problem , because i want to report R2 even it is negative

              Comment


              • #8
                for example i try to run 2 SLS use ivreg2 but Iveg2 but im not sure what is the code i should run to get R2
                HTML Code:
                ivreg2   hard_final_Exact_new   Firm_Size_w   ROA_four_w   DCAPEX_w TAX_rate_w     Leverage_w     Market_book_four_w   FREE_CASH_FLOW_w CASH_FLOW_VOLATILITY_w   Governance_Score_w   Fund_St
                > atus_w  FUNDING_RATIO_w  Platn_Size_w  Contribut_pension_three_w ACTUAL_RETURN_w  PensionBenefitsDiscountRate_w  CSR_Committee  SustainabilityScore_w   i.year    i.ff_12   (csopresence1 = C
                > SO_Percentage )   ,  first endog(csopresence1) robust 
                
                First-stage regressions
                -----------------------
                
                
                First-stage regression of csopresence1:
                
                Statistics robust to heteroskedasticity
                Number of obs =                   3059
                -----------------------------------------------------------------------------------------------
                                              |               Robust
                                 csopresence1 | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
                ------------------------------+----------------------------------------------------------------
                               CSO_Percentage |   1.060101   .1166123     9.09   0.000     .8314531    1.288748
                                  Firm_Size_w |   .0073951   .0116362     0.64   0.525    -.0154207    .0302108
                                   ROA_four_w |   .4802038   .3238439     1.48   0.138    -.1547737    1.115181
                                     DCAPEX_w |    .305529    .560944     0.54   0.586    -.7943429    1.405401
                                   TAX_rate_w |   .0066612   .0297564     0.22   0.823    -.0516837    .0650061
                                   Leverage_w |  -.0038466   .0663292    -0.06   0.954    -.1339018    .1262085
                           Market_book_four_w |   .0010832   .0012313     0.88   0.379     -.001331    .0034974
                             FREE_CASH_FLOW_w |  -.4811433   .3179622    -1.51   0.130    -1.104588    .1423016
                       CASH_FLOW_VOLATILITY_w |   1.968881   .4550355     4.33   0.000      1.07667    2.861093
                           Governance_Score_w |   .0000153   .0003888     0.04   0.969    -.0007471    .0007777
                                Fund_Status_w |   .2245248   .3368779     0.67   0.505    -.4360092    .8850587
                              FUNDING_RATIO_w |   .0435981   .0559566     0.78   0.436    -.0661188    .1533151
                                 Platn_Size_w |   .0478488   .0092268     5.19   0.000     .0297573    .0659404
                    Contribut_pension_three_w |   .2998949   .1896977     1.58   0.114    -.0720553     .671845
                              ACTUAL_RETURN_w |  -.1690191   .1012395    -1.67   0.095    -.3675246    .0294865
                PensionBenefitsDiscountRate_w |   .0271159   .0142545     1.90   0.057    -.0008337    .0550655
                                CSR_Committee |   .0923577   .0176967     5.22   0.000     .0576588    .1270566
                        SustainabilityScore_w |   .0020468   .0004968     4.12   0.000     .0010728    .0030209
                                              |
                                         year |
                                        2007  |  -.0665388    .027278    -2.44   0.015    -.1200241   -.0130535
                                        2008  |  -.1235205   .0449569    -2.75   0.006    -.2116699   -.0353711
                                        2009  |  -.0988303   .0323657    -3.05   0.002    -.1622913   -.0353693
                                        2010  |  -.0961957   .0336954    -2.85   0.004    -.1622641   -.0301273
                                        2011  |  -.0940176   .0383868    -2.45   0.014    -.1692845   -.0187506
                                        2012  |  -.0572442   .0435397    -1.31   0.189    -.1426148    .0281264
                                        2013  |  -.0561397   .0427078    -1.31   0.189    -.1398792    .0275997
                                        2014  |  -.0553636   .0486699    -1.14   0.255    -.1507932     .040066
                                        2015  |  -.0658538   .0517612    -1.27   0.203    -.1673447    .0356371
                                        2016  |  -.0228301   .0557455    -0.41   0.682    -.1321332    .0864729
                                        2017  |  -.0406276   .0608709    -0.67   0.505    -.1599803    .0787252
                                        2018  |  -.1038641   .0641402    -1.62   0.105     -.229627    .0218988
                                        2019  |  -.0872201    .072382    -1.20   0.228    -.2291432     .054703
                                        2020  |   -.101147    .082327    -1.23   0.219    -.2625698    .0602759
                                        2021  |  -.1478818   .0844054    -1.75   0.080    -.3133799    .0176163
                                        2022  |  -.1979142   .1038559    -1.91   0.057    -.4015499    .0057215
                                              |
                                        ff_12 |
                                           2  |   -.063688   .0504452    -1.26   0.207    -.1625985    .0352225
                                           3  |  -.0523361   .0363595    -1.44   0.150     -.123628    .0189557
                                           4  |  -.1946749   .0524603    -3.71   0.000    -.2975366   -.0918132
                                           5  |  -.0209982   .0393319    -0.53   0.593    -.0981182    .0561219
                                           6  |   .0542769   .0392218     1.38   0.167    -.0226274    .1311812
                                           7  |    .115612   .0666822     1.73   0.083    -.0151353    .2463593
                                           8  |  -.0480351   .0415184    -1.16   0.247    -.1294424    .0333721
                                           9  |    .040475   .0474909     0.85   0.394    -.0526428    .1335928
                                          10  |   .0577808   .0411136     1.41   0.160    -.0228327    .1383943
                                          11  |  -.0096359    .042691    -0.23   0.821    -.0933423    .0740705
                                          12  |   .0418197    .042227     0.99   0.322     -.040977    .1246165
                                              |
                                        _cons |  -.7475762   .1303139    -5.74   0.000    -1.003089   -.4920631
                -----------------------------------------------------------------------------------------------
                F test of excluded instruments:
                  F(  1,  3013) =    82.64
                  Prob > F      =   0.0000
                Sanderson-Windmeijer multivariate F test of excluded instruments:
                  F(  1,  3013) =    82.64
                  Prob > F      =   0.0000
                
                
                
                Summary results for first-stage regressions
                -------------------------------------------
                
                                                           (Underid)            (Weak id)
                Variable     | F(  1,  3013)  P-val | SW Chi-sq(  1) P-val | SW F(  1,  3013)
                csopresence1 |      82.64    0.0000 |       83.90   0.0000 |       82.64
                
                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)=75.59    P-val=0.0000
                
                Weak identification test
                Ho: equation is weakly identified
                Cragg-Donald Wald F statistic                                      72.71
                Kleibergen-Paap Wald rk F statistic                                82.64
                
                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,3013)=      5.33     P-val=0.0210
                Anderson-Rubin Wald test           Chi-sq(1)=      5.41     P-val=0.0200
                Stock-Wright LM S statistic        Chi-sq(1)=      9.91     P-val=0.0016
                
                NB: Underidentification, weak identification and weak-identification-robust
                    test statistics heteroskedasticity-robust
                
                Number of observations               N  =       3059
                Number of regressors                 K  =         46
                Number of endogenous regressors      K1 =          1
                Number of instruments                L  =         46
                Number of excluded instruments       L1 =          1
                
                IV (2SLS) estimation
                --------------------
                
                Estimates efficient for homoskedasticity only
                Statistics robust to heteroskedasticity
                
                                                                      Number of obs =     3059
                                                                      F( 45,  3013) =     1.23
                                                                      Prob > F      =   0.1377
                Total (centered) SS     =  74.11180124                Centered R2   =  -0.0282
                Total (uncentered) SS   =           76                Uncentered R2 =  -0.0027
                Residual SS             =   76.2031979                Root MSE      =    .1578
                
                -----------------------------------------------------------------------------------------------
                                              |               Robust
                         hard_final_Exact_new | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
                ------------------------------+----------------------------------------------------------------
                                 csopresence1 |   .1042133   .0459817     2.27   0.023     .0140909    .1943358
                                  Firm_Size_w |   -.005251   .0053861    -0.97   0.330    -.0158076    .0053056
                                   ROA_four_w |  -.4158489   .1277174    -3.26   0.001    -.6661705   -.1655273
                                     DCAPEX_w |  -.0145154   .2138214    -0.07   0.946    -.4335977    .4045669
                                   TAX_rate_w |  -.0029006   .0141369    -0.21   0.837    -.0306084    .0248073
                                   Leverage_w |  -.0253021    .024828    -1.02   0.308     -.073964    .0233598
                           Market_book_four_w |  -.0001865   .0006804    -0.27   0.784      -.00152     .001147
                             FREE_CASH_FLOW_w |   .3186146   .1257625     2.53   0.011     .0721247    .5651046
                       CASH_FLOW_VOLATILITY_w |  -.0503814   .1943168    -0.26   0.795    -.4312354    .3304725
                           Governance_Score_w |   .0003144   .0001643     1.91   0.056    -7.66e-06    .0006364
                                Fund_Status_w |  -.3227381   .1731365    -1.86   0.062    -.6620793    .0166032
                              FUNDING_RATIO_w |  -.0278129    .022463    -1.24   0.216    -.0718395    .0162138
                                 Platn_Size_w |  -.0078465   .0046602    -1.68   0.092    -.0169804    .0012874
                    Contribut_pension_three_w |  -.2299897   .0739341    -3.11   0.002    -.3748979   -.0850816
                              ACTUAL_RETURN_w |   .0529899   .0508561     1.04   0.297    -.0466862    .1526659
                PensionBenefitsDiscountRate_w |    .014494   .0052503     2.76   0.006     .0042035    .0247845
                                CSR_Committee |  -.0076634    .008703    -0.88   0.379    -.0247209    .0093942
                        SustainabilityScore_w |  -7.38e-06   .0002177    -0.03   0.973    -.0004342    .0004194
                                              |
                                         year |
                                        2007  |      .0053   .0112974     0.47   0.639    -.0168426    .0274425
                                        2008  |   .0211131   .0227913     0.93   0.354     -.023557    .0657831
                                        2009  |   .0268166    .017553     1.53   0.127    -.0075866    .0612199
                                        2010  |   .0143094   .0152084     0.94   0.347    -.0154986    .0441174
                                        2011  |   .0112982   .0136692     0.83   0.408    -.0154929    .0380892
                                        2012  |   .0298368   .0188988     1.58   0.114    -.0072042    .0668779
                                        2013  |   .0126508   .0163083     0.78   0.438    -.0193128    .0446144
                                        2014  |   .0251395   .0195377     1.29   0.198    -.0131536    .0634327
                                        2015  |   .0308501   .0225179     1.37   0.171    -.0132842    .0749843
                                        2016  |   .0067537   .0220942     0.31   0.760    -.0365502    .0500576
                                        2017  |   .0130813   .0231749     0.56   0.572    -.0323407    .0585033
                                        2018  |   .0283105   .0234347     1.21   0.227    -.0176207    .0742418
                                        2019  |   .0061874   .0251403     0.25   0.806    -.0430866    .0554615
                                        2020  |   .0363064   .0315524     1.15   0.250    -.0255353     .098148
                                        2021  |   .0112083   .0262557     0.43   0.669    -.0402518    .0626685
                                        2022  |   .0057365   .0336796     0.17   0.865    -.0602743    .0717472
                                              |
                                        ff_12 |
                                           2  |    .009545   .0241193     0.40   0.692     -.037728    .0568181
                                           3  |   .0036317   .0144021     0.25   0.801     -.024596    .0318593
                                           4  |   .0552658     .02681     2.06   0.039     .0027191    .1078124
                                           5  |   .0006602   .0157348     0.04   0.967    -.0301793    .0314998
                                           6  |   .0139097   .0161376     0.86   0.389    -.0177194    .0455387
                                           7  |   .0330205   .0308829     1.07   0.285    -.0275089    .0935499
                                           8  |   .0141687   .0173244     0.82   0.413    -.0197864    .0481239
                                           9  |   .0446592   .0263462     1.70   0.090    -.0069784    .0962969
                                          10  |   .0238154    .017521     1.36   0.174    -.0105251     .058156
                                          11  |   .0334088   .0205219     1.63   0.104    -.0068133    .0736309
                                          12  |   .0076372   .0154415     0.49   0.621    -.0226276     .037902
                                              |
                                        _cons |   .0464072   .0612628     0.76   0.449    -.0736657    .1664802
                -----------------------------------------------------------------------------------------------
                Underidentification test (Kleibergen-Paap rk LM statistic):             75.592
                                                                   Chi-sq(1) P-val =    0.0000
                ------------------------------------------------------------------------------
                Weak identification test (Cragg-Donald Wald F statistic):               72.712
                                         (Kleibergen-Paap rk Wald F statistic):         82.643
                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:                               4.130
                                                                   Chi-sq(1) P-val =    0.0421
                Regressors tested:    csopresence1
                ------------------------------------------------------------------------------
                Instrumented:         csopresence1
                Included instruments: Firm_Size_w ROA_four_w DCAPEX_w TAX_rate_w Leverage_w
                                      Market_book_four_w FREE_CASH_FLOW_w CASH_FLOW_VOLATILITY_w
                                      Governance_Score_w Fund_Status_w FUNDING_RATIO_w
                                      Platn_Size_w Contribut_pension_three_w ACTUAL_RETURN_w
                                      PensionBenefitsDiscountRate_w CSR_Committee
                                      SustainabilityScore_w 2007.year 2008.year 2009.year
                                      2010.year 2011.year 2012.year 2013.year 2014.year
                                      2015.year 2016.year 2017.year 2018.year 2019.year
                                      2020.year 2021.year 2022.year 2.ff_12 3.ff_12 4.ff_12
                                      5.ff_12 6.ff_12 7.ff_12 8.ff_12 9.ff_12 10.ff_12 11.ff_12
                                      12.ff_12
                Excluded instruments: CSO_Percentage
                ------------------------------------------------------------------------------

                Comment


                • #9
                  The link from post #2 outlines the formula for the R2, and gives an example of how to calculate it following the ivreg 2SLS command.

                  The information you need is also found by typing
                  Code:
                  ereturn list
                  after the ivreg command, see the values of e(rss) and e(mss).

                  Comment


                  • #10
                    Thank you very much for guidance please after i run
                    ereturn list i got
                    • e(mss): Model Sum of Squares = -2.091396653602786
                    • e(rss): Residual Sum of Squares = 76.2031978958388
                    then i use this formula to calculate R2
                    R2=MSS​ / ( MSS+RSS)

                    R2 −2.091396653602786 / ( −2.091396653602786 + 76.2031978958388 )

                    =-0.0282.


                    actually this value -0.0282. is the same of Centered R2 when i run ivreg2


                    please is R2 is the same of Centered R2 in second stage

                    Comment


                    • #11
                      I do not know this, one is advised not to use R2 in analyses of 2SLS. This is as said in the link in post #2.

                      I would rather study the postestimation commands available after ivregress available in Stata:.

                      In particular, the
                      Code:
                      estat firststage

                      Comment


                      • #12
                        R2 is essentially meaningless in 2SLS. why would you report it?

                        You can get a pseudo-R2 by the square of the correlation coefficient between the actual and predicted values.

                        Code:
                        sysuse auto, clear
                        ivregress 2sls price (mpg = foreign) headroom
                        predict yfit, xb
                        correl yfit price
                        di "pseudo-R2 = "  %5.3f r(rho)^2

                        Comment

                        Working...
                        X