Announcement

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

  • Stata Command: including interaction terms of the endogenous variable in 2SLS using xtivreg

    Hi,

    I am wondering if anyone had any experience in including an interaction term in 2SLS using xtivreg?

    I am now having a successful 2SLS, not including any interaction terms as follows:

    Code:
    xtivreg PatMV_real_log Lev CAPX_AT Size rd_log sale_log number_log (inverse_D = toughness_normalized) i.fyear, fe
    inverse_D is the endogenous variable and toughness is the instrumental variable

    This is successful, and I have the results like this:

    Code:
    Fixed-effects (within) IV regression            Number of obs     =      5,066
    Group variable: all_cluster                     Number of groups  =        554
    
    R-squared:                                      Obs per group:
         Within  =      .                                         min =          1
         Between = 0.2823                                         avg =        9.1
         Overall = 0.3891                                         max =         31
    
                                                    Wald chi2(37)     =   19922.00
    corr(u_i, Xb) = 0.0856                          Prob > chi2       =     0.0000
    
    ------------------------------------------------------------------------------
    PatMV_real~g | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
    -------------+----------------------------------------------------------------
       inverse_D |   13.87709   5.667382     2.45   0.014     2.769226    24.98496
             Lev |   .0032969   .0029638     1.11   0.266     -.002512    .0091058
         CAPX_AT |   1.526791   .6927957     2.20   0.028     .1689361    2.884645
            Size |   .0862929   .0621718     1.39   0.165    -.0355617    .2081474
          rd_log |   -.084102   .3179503    -0.26   0.791    -.7072731     .539069
        sale_log |   .1517564   .0322944     4.70   0.000     .0884605    .2150523
      number_log |   .0404435   .0334691     1.21   0.227    -.0251548    .1060417
                 |
           fyear |
           1986  |  -.1775167    .298694    -0.59   0.552    -.7629462    .4079129
           1987  |  -.0519888   .3001776    -0.17   0.862    -.6403262    .5363485
           1988  |  -.0481431   .3076404    -0.16   0.876    -.6511073     .554821
           1989  |   .0163748   .2844115     0.06   0.954    -.5410614     .573811
           1990  |  -.0718744   .2990964    -0.24   0.810    -.6580925    .5143437
           1991  |  -.2075746   .3433348    -0.60   0.545    -.8804984    .4653492
           1992  |  -.2268283   .3502615    -0.65   0.517    -.9133282    .4596715
           1993  |   .1302594   .3597807     0.36   0.717    -.5748978    .8354166
           1994  |    .394627    .391701     1.01   0.314    -.3730928    1.162347
           1995  |  -.2333602   .4519216    -0.52   0.606     -1.11911    .6523898
           1996  |   .1275317   .4482286     0.28   0.776    -.7509803    1.006044
           1997  |  -.1892146     .55809    -0.34   0.735    -1.283051    .9046217
           1998  |  -.3070482   .5836953    -0.53   0.599     -1.45107    .8369736
           1999  |  -.6370051   .6263369    -1.02   0.309    -1.864603    .5905927
           2000  |  -.8418151   .6641659    -1.27   0.205    -2.143556    .4599261
           2001  |  -1.119607   .7252079    -1.54   0.123    -2.540988    .3017744
           2002  |  -1.545625   .8150542    -1.90   0.058    -3.143102    .0518518
           2003  |  -1.636655   .8022847    -2.04   0.041    -3.209104   -.0642054
           2004  |  -1.786408   .8443835    -2.12   0.034    -3.441369   -.1314466
           2005  |  -1.878826   .8648506    -2.17   0.030    -3.573902   -.1837496
           2006  |  -2.023935   .8749888    -2.31   0.021    -3.738882   -.3089884
           2007  |  -2.223262   .9041965    -2.46   0.014    -3.995455   -.4510695
           2008  |  -2.062127   .8859147    -2.33   0.020    -3.798488   -.3257664
           2009  |   -2.24123   .9245712    -2.42   0.015    -4.053357   -.4291043
           2010  |  -2.249556   .9657848    -2.33   0.020    -4.142459   -.3566523
           2011  |  -2.138431    .923046    -2.32   0.021    -3.947568   -.3292945
           2012  |  -2.460573   .9528901    -2.58   0.010    -4.328203    -.592943
           2013  |  -3.264231   .9082721    -3.59   0.000    -5.044412   -1.484051
           2014  |  -4.738765   .8172058    -5.80   0.000    -6.340459   -3.137071
           2015  |  -7.135273     .62943   -11.34   0.000    -8.368933   -5.901613
                 |
           _cons |   1.398011    .499853     2.80   0.005     .4183173    2.377705
    -------------+----------------------------------------------------------------
         sigma_u |  1.6160709
         sigma_e |  1.3406031
             rho |   .5923664   (fraction of variance due to u_i)
    ------------------------------------------------------------------------------
     F test that all u_i=0: F(553,4475) =     4.74            Prob > F    = 0.0000
    ------------------------------------------------------------------------------
    Instrumented: inverse_D
     Instruments: Lev CAPX_AT Size rd_log sale_log number_log 1986.fyear
                  1987.fyear 1988.fyear 1989.fyear 1990.fyear 1991.fyear
                  1992.fyear 1993.fyear 1994.fyear 1995.fyear 1996.fyear
                  1997.fyear 1998.fyear 1999.fyear 2000.fyear 2001.fyear
                  2002.fyear 2003.fyear 2004.fyear 2005.fyear 2006.fyear
                  2007.fyear 2008.fyear 2009.fyear 2010.fyear 2011.fyear
                  2012.fyear 2013.fyear 2014.fyear 2015.fyear toughness_normalized
    And now, I want to add an interaction term: log_analysts. I found that in previous posts that integrating interaction terms into a new variable is recommended, so I did:

    Code:
    gen int_log_analysts = c.inverse_D#c.log_analysts
    
    gen int_log_analysts_iv = c.toughness_normalized#c.log_analysts
    And then I suppose that my code should be:

    Code:
    xtivreg PatMV_real_log Lev CAPX_AT Size rd_log sale_log number_log log_analysts (inverse_D int_log_analysts= toughness_normalized int_log_analysts_iv) i.fyear, fe
    I wonder if this is correct. In particular, I want to know if variable 'log_analysts' should exist outside the parenthesis, and more importantly: does this mean that I am using one instrumental variable 'toughness' on one endogenous variable 'inverse_D'? I was worried that this implies using 2 instruments on 2 endogenous variables, with 2x2 = 4 first stage estimations.

    For more information, I am trying to mimic the code using ivreg2:

    Code:
    ivreg2 y w (x c.x#c.w= z c.z#c.w)
    where w is the interaction term variable, x is the endogenous variable and z is the instrument. I don't know if it will be the same in xtivreg though. Any other suggestions or recommendations will be much appreciated.

    Many Thanks,
    Harry

  • #2
    Everything works the same with xtivreg. In fact, I think you can use factor notation now rather than having to define the interaction. One thing I would do is center the variable w (in the ivreg2 command) about its average before interacting it with x and z. That will make the coefficient on z in the first stage easier to interpret and, more importantly, force the coefficient on x to be the average partial effect.

    You are correct that the w variable belongs outside the parentheses at it is an exogenous variable and acts as its own instrument.

    Comment


    • #3
      Originally posted by Jeff Wooldridge View Post
      Everything works the same with xtivreg. In fact, I think you can use factor notation now rather than having to define the interaction. One thing I would do is center the variable w (in the ivreg2 command) about its average before interacting it with x and z. That will make the coefficient on z in the first stage easier to interpret and, more importantly, force the coefficient on x to be the average partial effect.

      You are correct that the w variable belongs outside the parentheses at it is an exogenous variable and acts as its own instrument.
      Hi Jeff,

      Thanks for the reply! I'm currently using STATA 17.0 SE, and
      Code:
      . xtivreg PatMV_real_log Lev CAPX_AT Size rd_log sale_log number_log c.log_analysts (
      > inverse_D c.inverse_D#c.log_analysts= toughness_normalized c.toughness_normalized#c
      > .log_analysts) i.fyear, fe
      depvars may not be interactions
      Other than that things seemed to be working. Thanks a lot!

      Comment


      • #4
        Hello!

        I am currently conducting an analysis aimed at understanding the differential effects of my variable, ln_legal_ha, across two distinct regions: the overall region, and another region specifically within ZME zones (where zme_dummy = 1). In order to carry out this analysis, I have executed two separate 2SLS regression models, making use of the xtivreg2 command in Stata. This approach closely aligns with the model proposed in this ongoing discussion.

        However, I have noticed differences in the Kleibergen-Paap rk Wald F statistic between these two models and I'm trying to discern what might be leading to these discrepancies. To my understanding, the Kleibergen-Paap rk Wald F statistic is utilized within the context of instrumental variable regression to test the null hypothesis that our instruments are weak, meaning that they are uncorrelated with the endogenous regressors. The interpretation of this statistic suggests that a larger value is indicative of stronger instruments. Therefore, the drop that I am witnessing in the statistic is a cause for concern.

        Any guidance or insights on this matter would be greatly appreciated.

        These are my results: ( I am using Stata 18)

        Code:
         xtivreg2 ln_rate_displacement (ln_legal_ha = instrument2) terror coca_crop_ha year_dummy* , fe cluster(m
        > un_code) first
        Warning - collinearities detected
        Vars dropped:       year_dummy21
        
        FIXED EFFECTS ESTIMATION
        ------------------------
        Number of groups =      1122                    Obs per group: min =        21
                                                                       avg =      21.0
                                                                       max =        21
        Warning - collinearities detected
        Vars dropped:  year_dummy21
        
        First-stage regressions
        -----------------------
        
        
        FIXED EFFECTS ESTIMATION
        ------------------------
        Number of groups =      1122                    Obs per group: min =        21
                                                                       avg =      21.0
                                                                       max =        21
        
        First-stage regression of ln_legal_ha:
        
        Statistics robust to heteroskedasticity and clustering on mun_code
        Number of obs =                  23562
        Number of clusters (mun_code) =   1122
        ------------------------------------------------------------------------------
                     |               Robust
         ln_legal_ha | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
        -------------+----------------------------------------------------------------
         instrument2 |    .613449   .0996371     6.16   0.000     .4181533    .8087447
              terror |   .0205875   .0252284     0.82   0.414    -.0288619    .0700368
        coca_crop_ha |   .0000477   .0000297     1.60   0.109    -.0000106    .0001059
         year_dummy1 |  -.0292766   .0314515    -0.93   0.352    -.0909237    .0323706
         year_dummy2 |  -.0565373   .0299063    -1.89   0.059    -.1151557    .0020811
         year_dummy3 |  -.0914659   .0298665    -3.06   0.002    -.1500064   -.0329255
         year_dummy4 |  -.0789681   .0288944    -2.73   0.006    -.1356032    -.022333
         year_dummy5 |   -.073261    .027846    -2.63   0.009     -.127841   -.0186809
         year_dummy6 |  -.0994106   .0269124    -3.69   0.000    -.1521609   -.0466604
         year_dummy7 |  -.0522922   .0290662    -1.80   0.072    -.1092639    .0046796
         year_dummy8 |  -.0689375   .0301594    -2.29   0.022     -.128052    -.009823
         year_dummy9 |  -.0175844   .0295243    -0.60   0.551    -.0754541    .0402854
        year_dummy10 |  -.0382615    .024036    -1.59   0.111    -.0853736    .0088507
        year_dummy11 |  -.0832753   .0288057    -2.89   0.004    -.1397365   -.0268141
        year_dummy12 |  -.0128858   .0278011    -0.46   0.643    -.0673778    .0416062
        year_dummy13 |  -.0153934    .023063    -0.67   0.504    -.0605985    .0298116
        year_dummy14 |  -.0005325   .0244218    -0.02   0.983     -.048401     .047336
        year_dummy15 |  -.0400893   .0242562    -1.65   0.098     -.087633    .0074545
        year_dummy16 |   .0378343   .0247247     1.53   0.126    -.0106278    .0862964
        year_dummy17 |   .0916008   .0236791     3.87   0.000      .045188    .1380135
        year_dummy18 |   .0131319    .020486     0.64   0.522    -.0270222    .0532859
        year_dummy19 |   .0145469   .0183182     0.79   0.427    -.0213582    .0504519
        year_dummy20 |  -.0399248   .0188167    -2.12   0.034    -.0768068   -.0030428
        year_dummy21 |          0  (omitted)
        ------------------------------------------------------------------------------
        F test of excluded instruments:
          F(  1,  1121) =    37.91
          Prob > F      =   0.0000
        Sanderson-Windmeijer multivariate F test of excluded instruments:
          F(  1,  1121) =    37.91
          Prob > F      =   0.0000
        
        
        
        Summary results for first-stage regressions
        -------------------------------------------
        
                                                   (Underid)            (Weak id)
        Variable     | F(  1,  1121)  P-val | SW Chi-sq(  1) P-val | SW F(  1,  1121)
        ln_legal_ha  |      37.91    0.0000 |       37.98   0.0000 |       37.91
        
        NB: first-stage test statistics cluster-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)=35.03    P-val=0.0000
        
        Weak identification test
        Ho: equation is weakly identified
        Cragg-Donald Wald F statistic                                     982.44
        Kleibergen-Paap Wald rk F statistic                                37.91
        
        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,1121)=     72.07     P-val=0.0000
        Anderson-Rubin Wald test           Chi-sq(1)=     72.21     P-val=0.0000
        Stock-Wright LM S statistic        Chi-sq(1)=     64.74     P-val=0.0000
        
        NB: Underidentification, weak identification and weak-identification-robust
            test statistics cluster-robust
        
        Number of clusters             N_clust  =       1122
        Number of observations               N  =      23562
        Number of regressors                 K  =         23
        Number of endogenous regressors      K1 =          1
        Number of instruments                L  =         23
        Number of excluded instruments       L1 =          1
        
        IV (2SLS) estimation
        --------------------
        
        Estimates efficient for homoskedasticity only
        Statistics robust to heteroskedasticity and clustering on mun_code
        
        Number of clusters (mun_code) =   1122                Number of obs =    23562
                                                              F( 23,  1121) =   106.44
                                                              Prob > F      =   0.0000
        Total (centered) SS     =  120880.6954                Centered R2   =   0.1764
        Total (uncentered) SS   =  120880.6954                Uncentered R2 =   0.1764
        Residual SS             =  99557.80502                Root MSE      =    2.106
        
        ------------------------------------------------------------------------------
                     |               Robust
        ln_rate_di~t | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
        -------------+----------------------------------------------------------------
         ln_legal_ha |   1.253122   .2381549     5.26   0.000      .786347    1.719897
              terror |   .4320092    .044179     9.78   0.000     .3454199    .5185985
        coca_crop_ha |    .000149   .0000396     3.76   0.000     .0000714    .0002266
         year_dummy1 |   3.430221   .1247621    27.49   0.000     3.185692    3.674751
         year_dummy2 |   3.897132   .1231214    31.65   0.000     3.655819    4.138446
         year_dummy3 |   3.553965   .1264553    28.10   0.000     3.306117    3.801813
         year_dummy4 |   3.550806   .1183822    29.99   0.000     3.318781    3.782831
         year_dummy5 |   3.613434   .1148947    31.45   0.000     3.388244    3.838623
         year_dummy6 |   3.642814   .1135996    32.07   0.000     3.420163    3.865465
         year_dummy7 |    3.67309   .1084828    33.86   0.000     3.460467    3.885712
         year_dummy8 |   3.304358   .1058579    31.22   0.000     3.096881    3.511836
         year_dummy9 |   2.529605   .1000324    25.29   0.000     2.333546    2.725665
        year_dummy10 |   1.795675   .0932082    19.27   0.000      1.61299     1.97836
        year_dummy11 |   1.780305   .0963259    18.48   0.000      1.59151      1.9691
        year_dummy12 |   1.925373   .0963339    19.99   0.000     1.736562    2.114184
        year_dummy13 |   2.112034   .0930321    22.70   0.000     1.929695    2.294374
        year_dummy14 |   2.060556   .0927674    22.21   0.000     1.878735    2.242376
        year_dummy15 |   1.720606   .0924471    18.61   0.000     1.539413    1.901799
        year_dummy16 |   1.129815   .0879648    12.84   0.000     .9574075    1.302223
        year_dummy17 |   .5553081   .0830768     6.68   0.000     .3924805    .7181356
        year_dummy18 |   .4999019   .0823196     6.07   0.000     .3385584    .6612453
        year_dummy19 |   .0147657   .0736492     0.20   0.841     -.129584    .1591154
        year_dummy20 |  -.4479701   .0763393    -5.87   0.000    -.5975924   -.2983479
        year_dummy21 |          0  (omitted)
        ------------------------------------------------------------------------------
        Underidentification test (Kleibergen-Paap rk LM statistic):             35.025
                                                           Chi-sq(1) P-val =    0.0000
        ------------------------------------------------------------------------------
        Weak identification test (Cragg-Donald Wald F statistic):              982.443
                                 (Kleibergen-Paap rk Wald F statistic):         37.907
        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)
        ------------------------------------------------------------------------------
        Instrumented:         ln_legal_ha
        Included instruments: terror coca_crop_ha year_dummy1 year_dummy2 year_dummy3
                              year_dummy4 year_dummy5 year_dummy6 year_dummy7
                              year_dummy8 year_dummy9 year_dummy10 year_dummy11
                              year_dummy12 year_dummy13 year_dummy14 year_dummy15
                              year_dummy16 year_dummy17 year_dummy18 year_dummy19
                              year_dummy20
        Excluded instruments: instrument2
        Dropped collinear:    year_dummy21
        ------------------------------------------------------------------------------
        
        .
        . // in zme zones
        .
        . gen instrument_zme = instrument2 * zme_dummy
        (1 missing value generated)
        
        . gen lnlegal_zme = ln_legal_ha * zme_dummy
        (1 missing value generated)
        
        .
        . xtivreg2 ln_rate_displacement coca_crop_ha zme_dummy year_dummy* terror (ln_legal_ha lnlegal_zme = instr
        > ument2 instrument_zme), fe cluster(mun_code) first
        Warning - collinearities detected
        Vars dropped:       zme_dummy year_dummy21
        
        FIXED EFFECTS ESTIMATION
        ------------------------
        Number of groups =      1122                    Obs per group: min =        21
                                                                       avg =      21.0
                                                                       max =        21
        Warning - collinearities detected
        Vars dropped:  zme_dummy year_dummy21
        
        First-stage regressions
        -----------------------
        
        
        FIXED EFFECTS ESTIMATION
        ------------------------
        Number of groups =      1122                    Obs per group: min =        21
                                                                       avg =      21.0
                                                                       max =        21
        
        First-stage regression of ln_legal_ha:
        
        Statistics robust to heteroskedasticity and clustering on mun_code
        Number of obs =                  23562
        Number of clusters (mun_code) =   1122
        --------------------------------------------------------------------------------
                       |               Robust
           ln_legal_ha | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
        ---------------+----------------------------------------------------------------
           instrument2 |   .4109556   .1040751     3.95   0.000     .2069612    .6149499
        instrument_zme |   .6767629   .2380131     2.84   0.004     .2102406    1.143285
          coca_crop_ha |   .0000424   .0000286     1.48   0.138    -.0000137    .0000984
             zme_dummy |          0  (omitted)
           year_dummy1 |  -.0285822   .0314254    -0.91   0.363    -.0901782    .0330137
           year_dummy2 |  -.0557878    .029883    -1.87   0.062    -.1143605     .002785
           year_dummy3 |  -.0910839   .0298398    -3.05   0.002    -.1495719   -.0325958
           year_dummy4 |  -.0787427   .0288616    -2.73   0.006    -.1353134   -.0221721
           year_dummy5 |  -.0730655   .0278593    -2.62   0.009    -.1276717   -.0184593
           year_dummy6 |  -.0994101   .0269065    -3.69   0.000    -.1521488   -.0466714
           year_dummy7 |  -.0522725   .0290816    -1.80   0.072    -.1092743    .0047294
           year_dummy8 |  -.0690675   .0301716    -2.29   0.022    -.1282059    -.009929
           year_dummy9 |  -.0178076   .0295455    -0.60   0.547    -.0757188    .0401036
          year_dummy10 |  -.0384256     .02404    -1.60   0.110    -.0855457    .0086945
          year_dummy11 |  -.0827822    .028785    -2.88   0.004    -.1392028   -.0263617
          year_dummy12 |  -.0120192   .0276638    -0.43   0.664    -.0662421    .0422038
          year_dummy13 |   -.014817   .0229478    -0.65   0.518    -.0597964    .0301624
          year_dummy14 |  -.0000993   .0243058    -0.00   0.997    -.0477404    .0475418
          year_dummy15 |  -.0397557   .0241909    -1.64   0.100    -.0871715    .0076601
          year_dummy16 |   .0379377    .024713     1.54   0.125    -.0105015     .086377
          year_dummy17 |   .0913747   .0236661     3.86   0.000     .0449874     .137762
          year_dummy18 |   .0128727   .0204837     0.63   0.530    -.0272767    .0530221
          year_dummy19 |   .0141505   .0183203     0.77   0.440    -.0217585    .0500596
          year_dummy20 |  -.0403134   .0188564    -2.14   0.033    -.0772734   -.0033535
          year_dummy21 |          0  (omitted)
                terror |   .0159255   .0244313     0.65   0.515    -.0319615    .0638126
        --------------------------------------------------------------------------------
        F test of excluded instruments:
          F(  2,  1121) =    20.34
          Prob > F      =   0.0000
        Sanderson-Windmeijer multivariate F test of excluded instruments:
          F(  1,  1121) =    26.07
          Prob > F      =   0.0000
        
        
        FIXED EFFECTS ESTIMATION
        ------------------------
        Number of groups =      1122                    Obs per group: min =        21
                                                                       avg =      21.0
                                                                       max =        21
        
        First-stage regression of lnlegal_zme:
        
        Statistics robust to heteroskedasticity and clustering on mun_code
        Number of obs =                  23562
        Number of clusters (mun_code) =   1122
        --------------------------------------------------------------------------------
                       |               Robust
           lnlegal_zme | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
        ---------------+----------------------------------------------------------------
           instrument2 |   -.013011   .0093928    -1.39   0.166    -.0314215    .0053995
        instrument_zme |   1.129027   .2146203     5.26   0.000     .7083559    1.549698
          coca_crop_ha |   .0000109   .0000166     0.65   0.514    -.0000217    .0000435
             zme_dummy |          0  (omitted)
           year_dummy1 |  -.0092521   .0193666    -0.48   0.633    -.0472121    .0287078
           year_dummy2 |  -.0212773   .0180335    -1.18   0.238    -.0566243    .0140697
           year_dummy3 |  -.0378648    .017972    -2.11   0.035    -.0730913   -.0026384
           year_dummy4 |  -.0308286   .0182999    -1.68   0.092    -.0666977    .0050404
           year_dummy5 |   -.017589   .0126131    -1.39   0.163    -.0423116    .0071337
           year_dummy6 |  -.0343534   .0133573    -2.57   0.010    -.0605346   -.0081723
           year_dummy7 |  -.0186262   .0140504    -1.33   0.185    -.0461659    .0089135
           year_dummy8 |  -.0103816   .0156303    -0.66   0.507    -.0410181     .020255
           year_dummy9 |   .0099454   .0165377     0.60   0.548    -.0224696    .0423604
          year_dummy10 |  -.0016365   .0147883    -0.11   0.912    -.0306226    .0273495
          year_dummy11 |  -.0268412   .0170884    -1.57   0.116    -.0603357    .0066532
          year_dummy12 |  -.0075724   .0140665    -0.54   0.590    -.0351436    .0199989
          year_dummy13 |   -.010816   .0133215    -0.81   0.417    -.0369272    .0152951
          year_dummy14 |  -.0223117   .0148615    -1.50   0.133    -.0514413    .0068179
          year_dummy15 |  -.0180329   .0169097    -1.07   0.286    -.0511771    .0151114
          year_dummy16 |   .0165845   .0128369     1.29   0.196    -.0085767    .0417458
          year_dummy17 |    .049236   .0129781     3.79   0.000      .023798     .074674
          year_dummy18 |   .0148787   .0102042     1.46   0.145    -.0051224    .0348797
          year_dummy19 |   .0091065   .0064517     1.41   0.158    -.0035392    .0217522
          year_dummy20 |  -.0218001   .0106351    -2.05   0.040    -.0426457   -.0009546
          year_dummy21 |          0  (omitted)
                terror |   .0256446   .0160596     1.60   0.110    -.0058334    .0571226
        --------------------------------------------------------------------------------
        F test of excluded instruments:
          F(  2,  1121) =    14.77
          Prob > F      =   0.0000
        Sanderson-Windmeijer multivariate F test of excluded instruments:
          F(  1,  1121) =    49.55
          Prob > F      =   0.0000
        
        
        
        Summary results for first-stage regressions
        -------------------------------------------
        
                                                   (Underid)            (Weak id)
        Variable     | F(  2,  1121)  P-val | SW Chi-sq(  1) P-val | SW F(  1,  1121)
        ln_legal_ha  |      20.34    0.0000 |       26.12   0.0000 |       26.07
        lnlegal_zme  |      14.77    0.0000 |       49.64   0.0000 |       49.55
        
        NB: first-stage test statistics cluster-robust
        
        Stock-Yogo weak ID F test critical values for single endogenous regressor:
                                           10% maximal IV size             19.93
                                           15% maximal IV size             11.59
                                           20% maximal IV size              8.75
                                           25% maximal IV size              7.25
        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)=16.04    P-val=0.0001
        
        Weak identification test
        Ho: equation is weakly identified
        Cragg-Donald Wald F statistic                                     296.42
        Kleibergen-Paap Wald rk F statistic                                 8.48
        
        Stock-Yogo weak ID test critical values for K1=2 and L1=2:
                                           10% maximal IV size              7.03
                                           15% maximal IV size              4.58
                                           20% maximal IV size              3.95
                                           25% maximal IV size              3.63
        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(2,1121)=     36.24     P-val=0.0000
        Anderson-Rubin Wald test           Chi-sq(2)=     72.62     P-val=0.0000
        Stock-Wright LM S statistic        Chi-sq(2)=     64.83     P-val=0.0000
        
        NB: Underidentification, weak identification and weak-identification-robust
            test statistics cluster-robust
        
        Number of clusters             N_clust  =       1122
        Number of observations               N  =      23562
        Number of regressors                 K  =         24
        Number of endogenous regressors      K1 =          2
        Number of instruments                L  =         24
        Number of excluded instruments       L1 =          2
        
        IV (2SLS) estimation
        --------------------
        
        Estimates efficient for homoskedasticity only
        Statistics robust to heteroskedasticity and clustering on mun_code
        
        Number of clusters (mun_code) =   1122                Number of obs =    23562
                                                              F( 24,  1121) =    97.11
                                                              Prob > F      =   0.0000
        Total (centered) SS     =  120880.6954                Centered R2   =   0.1191
        Total (uncentered) SS   =  120880.6954                Uncentered R2 =   0.1191
        Residual SS             =  106485.1948                Root MSE      =    2.178
        
        ------------------------------------------------------------------------------
                     |               Robust
        ln_rate_di~t | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
        -------------+----------------------------------------------------------------
         ln_legal_ha |   1.769159   .4884995     3.62   0.000      .811718    2.726601
         lnlegal_zme |  -.9746277   .4931153    -1.98   0.048    -1.941116   -.0081395
        coca_crop_ha |   .0001436   .0000425     3.38   0.001     .0000602    .0002269
           zme_dummy |          0  (omitted)
         year_dummy1 |   3.435183   .1280892    26.82   0.000     3.184133    3.686233
         year_dummy2 |   3.904351   .1268376    30.78   0.000     3.655754    4.152948
         year_dummy3 |   3.563639   .1309439    27.22   0.000     3.306994    3.820285
         year_dummy4 |   3.561144   .1221877    29.14   0.000      3.32166    3.800627
         year_dummy5 |   3.633779   .1214572    29.92   0.000     3.395727    3.871831
         year_dummy6 |   3.660631   .1191296    30.73   0.000     3.427141     3.89412
         year_dummy7 |   3.681889   .1137976    32.35   0.000     3.458849    3.904928
         year_dummy8 |   3.330026   .1120078    29.73   0.000     3.110495    3.549557
         year_dummy9 |   2.548736   .1050657    24.26   0.000     2.342811     2.75466
        year_dummy10 |   1.814091    .096257    18.85   0.000     1.625431    2.002751
        year_dummy11 |   1.796316   .0999536    17.97   0.000     1.600411    1.992222
        year_dummy12 |   1.923233   .1005084    19.14   0.000      1.72624    2.120226
        year_dummy13 |   2.108499   .0951483    22.16   0.000     1.922012    2.294986
        year_dummy14 |    2.03838   .0943668    21.60   0.000     1.853425    2.223336
        year_dummy15 |   1.723176   .0940175    18.33   0.000     1.538905    1.907447
        year_dummy16 |   1.126287   .0910478    12.37   0.000     .9478367    1.304737
        year_dummy17 |    .556393   .0851906     6.53   0.000     .3894226    .7233634
        year_dummy18 |   .5080478   .0851735     5.96   0.000     .3411109    .6749848
        year_dummy19 |   .0167788   .0764369     0.22   0.826    -.1330348    .1665924
        year_dummy20 |  -.4479825   .0784852    -5.71   0.000    -.6018107   -.2941544
        year_dummy21 |          0  (omitted)
              terror |   .4539593   .0466707     9.73   0.000     .3624865    .5454321
        ------------------------------------------------------------------------------
        Underidentification test (Kleibergen-Paap rk LM statistic):             16.036
                                                           Chi-sq(1) P-val =    0.0001
        ------------------------------------------------------------------------------
        Weak identification test (Cragg-Donald Wald F statistic):              296.417
                                 (Kleibergen-Paap rk Wald F statistic):          8.479
        Stock-Yogo weak ID test critical values: 10% maximal IV size              7.03
                                                 15% maximal IV size              4.58
                                                 20% maximal IV size              3.95
                                                 25% maximal IV size              3.63
        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)
        ------------------------------------------------------------------------------
        Instrumented:         ln_legal_ha lnlegal_zme
        Included instruments: coca_crop_ha year_dummy1 year_dummy2 year_dummy3
                              year_dummy4 year_dummy5 year_dummy6 year_dummy7
                              year_dummy8 year_dummy9 year_dummy10 year_dummy11
                              year_dummy12 year_dummy13 year_dummy14 year_dummy15
                              year_dummy16 year_dummy17 year_dummy18 year_dummy19
                              year_dummy20 terror
        Excluded instruments: instrument2 instrument_zme
        Dropped collinear:    zme_dummy year_dummy21
        ------------------------------------------------------------------------------
        
        .
        end of do-file
        Last edited by Paola Jaimes; 10 Jul 2023, 17:57.

        Comment

        Working...
        X