Announcement

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

  • Opposite sign for 2SLS and rreg coefficient

    Hi

    I ran a 2SLS regression with BMI as the dependent variable and exercise as the independent variable. The former is a continuous variable and the latter is measured in number of days. My results show a negative coefficient for exercise. My results from using rreg show that the coefficient for exercise is positive. Do these results sound "normal", or should I be concerned?

    Kind Regards
    Nonsi Nkomo
    Last edited by nonsi nkomo; 06 Jul 2018, 09:32.

  • #2
    Nonsi:
    you don't share what you typed and what Stata gave you back. Hence: who knows what's the matter with your dataset?
    At a very first glance you ran two very different models (by the way, -rreg- has been basically side-tracked in the last years), hence no wonder that you got different results and flipping signs of your coefficients.
    Eventually, I fail to get the theoretical link between -ivregress- and -rreg-: if you have endogenous regressors, how can it be that they disappear if you switch to -rreg-?
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Hi Carlo

      Here are the results and commands for the rreg and 2SLS respectively.
      Code:
       
      
      . rreg bodymass i.ex1 W2ExPEYP W6FriendNumYP sex1 eth1 W8EVERMAR wksearly W8DINCW inc2 W8W
      > RKHRSA W8DDEGP W8GENA W1yschat W8SOCIALMED W1tvYP W8SLEEP2 W8AUDIT2 takeaway W8NOFCIGS W
      > 1fameatYP W5agebd10mum educp W8LOIL
      
         Huber iteration 1:  maximum difference in weights = .75417667
         Huber iteration 2:  maximum difference in weights = .13798294
         Huber iteration 3:  maximum difference in weights = .04567642
      Biweight iteration 4:  maximum difference in weights = .2953759
      Biweight iteration 5:  maximum difference in weights = .03444413
      Biweight iteration 6:  maximum difference in weights = .01333769
      Biweight iteration 7:  maximum difference in weights = .00490729
      
      Robust regression                               Number of obs     =      1,581
                                                      F( 24,      1556) =      11.44
                                                      Prob > F          =     0.0000
      
      -------------------------------------------------------------------------------
           bodymass |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
      --------------+----------------------------------------------------------------
                ex1 |
                 2  |    .042047   .0126076     3.34   0.001     .0173173    .0667766
                 3  |   .0474753   .0142525     3.33   0.001     .0195191    .0754314
                    |
           W2ExPEYP |  -.0009637    .008418    -0.11   0.909    -.0174755    .0155482
      W6FriendNumYP |  -.0076597   .0037825    -2.03   0.043    -.0150789   -.0002404
               sex1 |  -.0473381   .0088148    -5.37   0.000    -.0646282    -.030048
               eth1 |  -.0368955   .0133384    -2.77   0.006    -.0630586   -.0107324
          W8EVERMAR |   .0629756   .0132243     4.76   0.000     .0370363     .088915
           wksearly |  -.0052875   .0021844    -2.42   0.016    -.0095721   -.0010029
            W8DINCW |   .0011832   .0005497     2.15   0.032      .000105    .0022614
               inc2 |  -.0344596   .0150738    -2.29   0.022    -.0640267   -.0048926
          W8WRKHRSA |   -.034302   .0129911    -2.64   0.008    -.0597839     -.00882
            W8DDEGP |  -.0161561   .0087152    -1.85   0.064    -.0332508    .0009386
             W8GENA |   .0361508   .0049871     7.25   0.000     .0263688    .0459329
          W1yschat1 |   .0011352   .0006528     1.74   0.082    -.0001452    .0024156
        W8SOCIALMED |   .0028627   .0015897     1.80   0.072    -.0002555    .0059809
             W1tvYP |   .0082393   .0072707     1.13   0.257     -.006022    .0225006
           W8SLEEP2 |  -.0184265   .0038706    -4.76   0.000    -.0260186   -.0108344
           W8AUDIT2 |   .0142315   .0037959     3.75   0.000      .006786     .021677
           takeaway |     -.0201   .0082454    -2.44   0.015    -.0362733   -.0039268
          W8NOFCIGS |  -.0040771   .0011826    -3.45   0.001    -.0063969   -.0017574
         W1fameatYP |  -.0093275    .004269    -2.18   0.029    -.0177011   -.0009539
       W5agebd10mum |  -.0167242    .006939    -2.41   0.016    -.0303349   -.0031135
              educp |   .0257264   .0093114     2.76   0.006     .0074623    .0439905
             W8LOIL |  -.0087978   .0113105    -0.78   0.437    -.0309832    .0133876
              _cons |   4.146277   .3362552    12.33   0.000     3.486716    4.805838
      -------------------------------------------------------------------------------
      
      . 
      end of do-file
      
      . do "C:\Users\NONSIN~1\AppData\Local\Temp\STD1f88_000000.tmp"
      
      . ivregress 2sls bodymass (ex1 = i.W2ExPEYP W6FriendNumYP) sex1 eth1 W8EVERMAR wksearly W8
      > DINCW inc2 W8WRKHRSA W8DDEGP crime W8GENA W1yschat W8SOCIALMED W8SLEEP2 W8AUDIT2 takeawa
      > y W8NOFCIGS W1fameatYP W5agebd10mum educp W4Hea1CMP, first
      
      First-stage regressions
      -----------------------
      
                                                      Number of obs     =      1,496
                                                      F(  22,   1473)   =       8.26
                                                      Prob > F          =     0.0000
                                                      R-squared         =     0.1098
                                                      Adj R-squared     =     0.0965
                                                      Root MSE          =     0.5762
      
      -------------------------------------------------------------------------------
                ex1 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
      --------------+----------------------------------------------------------------
               sex1 |  -.1835183   .0334267    -5.49   0.000    -.2490872   -.1179494
               eth1 |  -.1183372   .0508423    -2.33   0.020    -.2180681   -.0186062
          W8EVERMAR |   .0145463   .0509227     0.29   0.775    -.0853425    .1144352
           wksearly |  -.0080275   .0083443    -0.96   0.336    -.0243955    .0083405
            W8DINCW |  -.0014621   .0021113    -0.69   0.489    -.0056036    .0026793
               inc2 |   .0152051       .058     0.26   0.793    -.0985663    .1289766
          W8WRKHRSA |   .0406568   .0499519     0.81   0.416    -.0573276    .1386412
            W8DDEGP |  -.0515102   .0330696    -1.56   0.120    -.1163788    .0133584
              crime |  -.0449501   .0373281    -1.20   0.229     -.118172    .0282718
             W8GENA |  -.1161386   .0176203    -6.59   0.000    -.1507022    -.081575
          W1yschat1 |   .0017466   .0024856     0.70   0.482    -.0031292    .0066224
        W8SOCIALMED |    .001861   .0060091     0.31   0.757    -.0099264    .0136484
           W8SLEEP2 |  -.0196757   .0148171    -1.33   0.184    -.0487406    .0093893
           W8AUDIT2 |   .0072065   .0144651     0.50   0.618     -.021168    .0355809
           takeaway |   .0987126   .0313586     3.15   0.002     .0372002     .160225
          W8NOFCIGS |  -.0027751   .0044742    -0.62   0.535    -.0115515    .0060014
         W1fameatYP |  -.0034978   .0162456    -0.22   0.830    -.0353646    .0283691
       W5agebd10mum |  -.0133767   .0264829    -0.51   0.614     -.065325    .0385716
              educp |   .0029759   .0355242     0.08   0.933    -.0667076    .0726593
          W4Hea1CMP |   .0177198   .0230165     0.77   0.441    -.0274289    .0628684
                    |
           W2ExPEYP |
                No  |  -.1030739   .0319985    -3.22   0.001    -.1658414   -.0403063
      W6FriendNumYP |   .0552231   .0143872     3.84   0.000     .0270015    .0834447
              _cons |   4.257115    2.46197     1.73   0.084    -.5722253    9.086455
      -------------------------------------------------------------------------------
      
      
      Instrumental variables (2SLS) regression          Number of obs   =      1,496
                                                        Wald chi2(21)   =     175.40
                                                        Prob > chi2     =     0.0000
                                                        R-squared       =          .
                                                        Root MSE        =     .18311
      
      ------------------------------------------------------------------------------
          bodymass |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
      -------------+----------------------------------------------------------------
               ex1 |  -.1227482   .0607943    -2.02   0.043    -.2419028   -.0035935
              sex1 |  -.0603355    .016776    -3.60   0.000    -.0932158   -.0274552
              eth1 |  -.0507507   .0176463    -2.88   0.004    -.0853368   -.0161647
         W8EVERMAR |   .0514247   .0162081     3.17   0.002     .0196574    .0831921
          wksearly |   -.008061   .0027281    -2.95   0.003    -.0134079    -.002714
           W8DINCW |   .0012493   .0006762     1.85   0.065    -.0000761    .0025746
              inc2 |  -.0385381   .0184437    -2.09   0.037    -.0746871   -.0023892
         W8WRKHRSA |  -.0204198   .0159202    -1.28   0.200    -.0516228    .0107832
           W8DDEGP |  -.0264327   .0110701    -2.39   0.017    -.0481298   -.0047356
             crime |   .0075083   .0120574     0.62   0.533    -.0161237    .0311404
            W8GENA |   .0233859   .0093928     2.49   0.013     .0049763    .0417955
         W1yschat1 |   .0022762   .0007936     2.87   0.004     .0007208    .0038317
       W8SOCIALMED |   .0043274   .0019092     2.27   0.023     .0005855    .0080693
          W8SLEEP2 |  -.0239701   .0048531    -4.94   0.000    -.0334819   -.0144583
          W8AUDIT2 |   .0154266   .0046634     3.31   0.001     .0062866    .0245666
          takeaway |  -.0083336   .0114321    -0.73   0.466    -.0307402    .0140729
         W8NOFCIGS |  -.0026457   .0014381    -1.84   0.066    -.0054645     .000173
        W1fameatYP |  -.0060647   .0051682    -1.17   0.241    -.0161943    .0040648
      W5agebd10mum |  -.0142033   .0084834    -1.67   0.094    -.0308305     .002424
             educp |   .0246994   .0112523     2.20   0.028     .0026453    .0467535
         W4Hea1CMP |   .0023737   .0074278     0.32   0.749    -.0121846     .016932
             _cons |   4.763027   .8329812     5.72   0.000     3.130414     6.39564
      ------------------------------------------------------------------------------
      Instrumented:  ex1
      Instruments:   sex1 eth1 W8EVERMAR wksearly W8DINCW inc2 W8WRKHRSA W8DDEGP
                     crime W8GENA W1yschat1 W8SOCIALMED W8SLEEP2 W8AUDIT2 takeaway
                     W8NOFCIGS W1fameatYP W5agebd10mum educp W4Hea1CMP 2.W2ExPEYP
                     W6FriendNumYP
      
      . 
      end of do-file
      
      .
      With regards to the use of 2SLS and rreg regressions, is it recommended that if I have an endogenous variable (which is exercise in my example), to use 2SLS only?

      Kind Regards
      Nonsi Nkomo

      Comment


      • #4
        Nonsi:
        I would get rid of -rreg- and focus on -ivregress- only:
        1) your first stage regression reports that both instruments of your endogenous regressor are statistical significant;
        2) if I'm not mistaken, the coefficient for -ex1- in -2SLS- shows that, when adjusted for the remaining predictors, a one-day increase in exercise, reduces BMI of 0.123. The direction of the effect of -ex1- seems reasonable (I cannot say about its magnitude, though). Hence: what's the reason of your concern?
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5
          Hi Carlo

          My apologies, I should have mentioned that the dependent variable is the log of BMI. Therefore the results show that an extra day of exercise reduces BMI by 12.3%. I'm hoping this makes more "sense" in terms of the magnitude of the coefficient. I was worried about the results from rreg and 2sls reporting opposite signs for the coefficient of exercise. However, you have explained the issue of the endogenous variable, exercise, and how I should focus on ivregress. I think your explanation has pretty much addressed my previous concerns. Thank you so much for the help.

          Kind Regards
          Nonsi Nkomo

          Comment


          • #6
            Nonsi:
            thanks for prividing further details about the metric of the dependent variable, that allows me to point out that, in log-linear regression models, the percentage approximation (-12.3% in BMI) works for small coefficient only (say 0.002).
            In all the other cases, a more precise estimate comes from the following approach (let's consider again the effect of -ex1- on BMI as per 2SLS regression):
            Code:
            . di (exp( -.1227482)-1)*100
            -11.551365
            Hence, each day of physical exercise/training reduces the BMI by a smaller 11.55%.
            Kind regards,
            Carlo
            (Stata 19.0)

            Comment


            • #7
              Thank you for that Carlo. I have also noticed that the correlation between exercise and BMI is positive. Should I be concerned?

              Kind Regards
              Nonsi Nkomo

              Comment


              • #8
                Nonsi:
                no, you don't, as the results of 2SLS should be read as the effect of a 1-day increase in -ex1- on reducing BMI when adjusted for the remaining predictors.
                Hence a head-to-head correlation (set aside the endogeneity issue, that correlation cannot take into account) does not seem that useful.
                Kind regards,
                Carlo
                (Stata 19.0)

                Comment


                • #9
                  Ah ok makes sense Carlos. Thanks again for the help.

                  Kind Regards
                  Nonsi Nkomo

                  Comment

                  Working...
                  X