Announcement

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

  • Endogeneity in Panel Data - 2SLS or Control Function

    Dear all, Dear Jeff Jeff Wooldridge, Dear Joao Joao Santos Silva

    I have a question on endogeneity in the case of panel data.
    I am running a linear regression on a performance variable and I want to test whether my independent variable (count variable) is endogenous. I have a strong instrument. However, I am unsure how to interpret my results and whether I should go with 2SLS or a control function approach.

    My independent variable is significant in the normal model (xtreg) but it becomes insignificant if I use 2SLS. The endog() option indicates that endogeneity is not present. If I understand correctly, I can now just go with the original model. Yet, I was thinking about what it means that my IV becomes insignificant in the 2SLS regression as significance is still important in my field. Can the reason be that my independent variable is a count variable?

    I also used the control function approach, where I regressed my endogenous count variable on the instrument and exogenous variables to receive the residuals. Implementing the residuals in the linear second stage shows that the residuals are not significant, supporting the idea that my model does not suffer from endogeneity.

    To sum up:
    1) Can the count nature of my independent variable be the reason for the insignificant 2SLS?
    2) Should I have greater trust in the results of the control function approach than the 2SLS due to the count nature of my independent variable?

    Thank you in advance.

    Patrick

  • #2
    Patrick:
    without further details from your side, the lack of significance might be due to the poor perfomance of IV estimators in finite samples.
    That said, if you do not have endogeneity, the issue is simply theoretical with no bearing on your research.
    Last edited by Carlo Lazzaro; 27 Oct 2024, 10:38.
    Kind regards,
    Carlo
    (StataNow 18.5)

    Comment


    • #3
      I'll call y1 your outcome variable and y2 the possibly endogenous count explanatory variable. The control function approach would impose more restrictions than a direct IV (2SLS) approach. First: are you using fixed effects 2SLS, or just pooled 2SLS? The CF approach with fixed effects is tricky to implement.

      It's pretty common to find OLS-type estimates (such as fixed effects) statistically significant but then it goes away when using IV because the standard errors can be a lot larger. How close are the point estimates? That matters, too.

      To possibly get a stronger IV, you can use a pooled Poisson regression (no fixed effects) in the first stage, and then use the predicted (fitted) values as IVs in the structural equation. As IVs, not regressors. This could be more efficient than just using z. You can at least try.

      Code:
      poisson y2 z x1 ... xK i.year
      predict y2hat
      xtivreg y1 x1 ... xK i.year (y2 = y2hat), fe vce(cluster id)

      Comment


      • #4
        Dear Carlo Lazzaro Dear Jeff Wooldridge.
        thanks for your response. Please see my code and results below.

        ENV = DV
        GREEN = IV
        A = Instrument
        US, esg_diff_l1, env_asp_50 = Moderators

        regression without moderators:

        Code:
        xtreg ENV GREEN_L1 Totalassets_L1 ROA_L1 SustCommitt_L1 TMTESG_L1 GDP_L1 FDI_L1 i.Year, fe vce(robust)
        
        
        Fixed-effects (within) regression               Number of obs     =      1,282
        Group variable: UltimatePa~D                    Number of groups  =        303
        
        R-sq:                                           Obs per group:
             within  = 0.1785                                         min =          1
             between = 0.0245                                         avg =        4.2
             overall = 0.0278                                         max =          7
        
                                                        F(11,302)         =          .
        corr(u_i, Xb)  = 0.0086                         Prob > F          =          .
        
                               (Std. Err. adjusted for 303 clusters in UltimateParentID)
        --------------------------------------------------------------------------------
                       |               Robust
                   ENV |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
        ---------------+----------------------------------------------------------------
              GREEN_L1 |   .0706161   .0333915     2.11   0.035     .0049067    .1363255
        Totalassets_L1 |  -3.71e-11   1.99e-11    -1.87   0.063    -7.62e-11    2.04e-12
                ROA_L1 |  -.0183744   .0559427    -0.33   0.743    -.1284613    .0917124
        SustCommitt_L1 |   4.724845   2.298711     2.06   0.041     .2013261    9.248363
             TMTESG_L1 |   1.165522    1.85229     0.63   0.530    -2.479507    4.810551
                GDP_L1 |   6.43e-14   7.97e-13     0.08   0.936    -1.50e-12    1.63e-12
                FDI_L1 |  -.1313245   .0410239    -3.20   0.002    -.2120534   -.0505956
                       |
                  Year |
                 2012  |   1.234965    .713585     1.73   0.085    -.1692634    2.639194
                 2013  |   .7390459   .9655426     0.77   0.445    -1.160997    2.639089
                 2014  |    1.82851    1.35395     1.35   0.178    -.8358604     4.49288
                 2015  |   5.375504   1.627573     3.30   0.001     2.172684    8.578323
                 2016  |   8.278887   1.898751     4.36   0.000      4.54243    12.01534
                 2017  |   9.793768    2.18797     4.48   0.000     5.488171    14.09936
                       |
                 _cons |   29.15956   9.350597     3.12   0.002     10.75899    47.56013
        ---------------+----------------------------------------------------------------
               sigma_u |  27.497799
               sigma_e |   8.392172
                   rho |  .91479292   (fraction of variance due to u_i)
        --------------------------------------------------------------------------------
        regression with moderators:

        Code:
        xtreg ENV c.GREEN_L1##c.US c.GREEN_L1##c.esg_diff_l1 c.GREEN_L1##c.ENV_L1_asp50 Totalassets_L1 ROA_L1 SustCommitt_L1 TMTESG_L1 GDP_L1 FDI_L1 i.Year, fe vce(robust)
        
         xtreg ENV c.GREEN_L1##c.US c.GREEN_L1##c.esg_diff_l1 c.GREEN_L1##c.ENV_L1_asp50 Totalassets_L1 ROA_L1 SustCommitt_L1 TMTESG_
        > L1 GDP_L1 FDI_L1 i.Year, fe vce(robust)
        note: US omitted because of collinearity
        note: GREEN_L1 omitted because of collinearity
        note: GREEN_L1 omitted because of collinearity
        note: 2017.Year omitted because of collinearity
        
        Fixed-effects (within) regression               Number of obs     =      1,281
        Group variable: UltimatePa~D                    Number of groups  =        303
        
        R-sq:                                           Obs per group:
             within  = 0.2470                                         min =          1
             between = 0.2781                                         avg =        4.2
             overall = 0.3670                                         max =          7
        
                                                        F(15,302)         =          .
        corr(u_i, Xb)  = 0.4192                         Prob > F          =          .
        
                                          (Std. Err. adjusted for 303 clusters in UltimateParentID)
        -------------------------------------------------------------------------------------------
                                  |               Robust
                              ENV |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
        --------------------------+----------------------------------------------------------------
                         GREEN_L1 |  -.0791057    .040218    -1.97   0.050    -.1582486    .0000372
                               US |          0  (omitted)
                                  |
                  c.GREEN_L1#c.US |   .2008018   .0437698     4.59   0.000     .1146694    .2869341
                                  |
                         GREEN_L1 |          0  (omitted)
                      esg_diff_l1 |   .0500829   .0129069     3.88   0.000     .0246841    .0754816
                                  |
         c.GREEN_L1#c.esg_diff_l1 |  -.0003926   .0001775    -2.21   0.028    -.0007419   -.0000433
                                  |
                         GREEN_L1 |          0  (omitted)
                     ENV_L1_asp50 |  -11.15899   1.841666    -6.06   0.000    -14.78311   -7.534865
                                  |
        c.GREEN_L1#c.ENV_L1_asp50 |   .0686748   .0269485     2.55   0.011     .0156441    .1217054
                                  |
                   Totalassets_L1 |  -2.21e-11   1.89e-11    -1.17   0.243    -5.93e-11    1.51e-11
                           ROA_L1 |  -.0066717    .053082    -0.13   0.900    -.1111291    .0977857
                   SustCommitt_L1 |   4.070186   1.974171     2.06   0.040      .185313     7.95506
                        TMTESG_L1 |   1.562657   1.765276     0.89   0.377    -1.911142    5.036456
                           GDP_L1 |   2.69e-13   7.50e-13     0.36   0.720    -1.21e-12    1.75e-12
                           FDI_L1 |  -.1276608   .0466581    -2.74   0.007    -.2194769   -.0358448
                                  |
                             Year |
                            2012  |   .6737387    .684234     0.98   0.326    -.6727313    2.020209
                            2013  |  -.1225301    .845698    -0.14   0.885    -1.786737    1.541677
                            2014  |   .4899508   1.182492     0.41   0.679    -1.837015    2.816917
                            2015  |   3.556686   1.372513     2.59   0.010     .8557872    6.257585
                            2016  |   2.106662   .7334661     2.87   0.004     .6633107    3.550014
                            2017  |          0  (omitted)
                                  |
                            _cons |   27.97122   7.953789     3.52   0.001     12.31935    43.62308
        --------------------------+----------------------------------------------------------------
                          sigma_u |  24.571283
                          sigma_e |  8.0544885
                              rho |  .90297251   (fraction of variance due to u_i)
        -------------------------------------------------------------------------------------------
        
        .
        2SLS:

        Code:
        xi: xtivreg2 ENV US esg_diff_l1 ENV_L1_asp50 Totalassets_L1 ROA_L1 SustCommitt_L1 TMTESG_L1 GDP_L1 FDI_L1 (GREEN_L1 = A_L1) i.Year, fe cluster (UltimateParentID) endog(GREEN_L1)
        
         xi: xtivreg2 ENV US esg_diff_l1 ENV_L1_asp50 Totalassets_L1 ROA_L1 SustCommitt_L1 TMTESG_L1 GDP_L1 FDI_L1 (GREEN_L1 = A_L1) 
        > i.Year, fe cluster (UltimateParentID) endog(GREEN_L1)
        i.Year            _IYear_2011-2017    (naturally coded; _IYear_2011 omitted)
        Warning - singleton groups detected.  58 observation(s) not used.
        Warning - collinearities detected
        Vars dropped:       US _IYear_2017
        
        FIXED EFFECTS ESTIMATION
        ------------------------
        Number of groups =       200                    Obs per group: min =         2
                                                                       avg =       5.2
                                                                       max =         7
        Warning - collinearities detected
        Vars dropped:  US _IYear_2017
        
        IV (2SLS) estimation
        --------------------
        
        Estimates efficient for homoskedasticity only
        Statistics robust to heteroskedasticity and clustering on UltimateParentID
        
        Number of clusters (UltimateParentID) =    200        Number of obs =     1040
                                                              F( 14,   199) =     7.07
                                                              Prob > F      =   0.0000
        Total (centered) SS     =  76676.37042                Centered R2   =   0.2613
        Total (uncentered) SS   =  76676.37042                Uncentered R2 =   0.2613
        Residual SS             =  56641.77389                Root MSE      =    8.212
        
        --------------------------------------------------------------------------------
                       |               Robust
                   ENV |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
        ---------------+----------------------------------------------------------------
              GREEN_L1 |   .0561861   .0505688     1.11   0.267    -.0429268    .1552991
                    US |          0  (omitted)
           esg_diff_l1 |   .0647373   .0152308     4.25   0.000     .0348855    .0945891
          ENV_L1_asp50 |  -11.45042   1.844418    -6.21   0.000    -15.06541   -7.835427
        Totalassets_L1 |  -4.41e-11   1.76e-11    -2.51   0.012    -7.85e-11   -9.71e-12
                ROA_L1 |   .0547771   .0542143     1.01   0.312     -.051481    .1610351
        SustCommitt_L1 |   3.460566   2.056303     1.68   0.092    -.5697138    7.490845
             TMTESG_L1 |   1.785902   2.004468     0.89   0.373    -2.142783    5.714586
                GDP_L1 |  -2.69e-13   8.50e-13    -0.32   0.752    -1.93e-12    1.40e-12
                FDI_L1 |  -.1271627   .0573526    -2.22   0.027    -.2395717   -.0147537
           _IYear_2012 |   1.299108   .7881458     1.65   0.099    -.2456292    2.843846
           _IYear_2013 |    .761549   .9948611     0.77   0.444    -1.188343    2.711441
           _IYear_2014 |   1.772139   1.378053     1.29   0.198    -.9287951    4.473073
           _IYear_2015 |   5.206214   1.606503     3.24   0.001     2.057525    8.354903
           _IYear_2016 |   2.634274   .9048955     2.91   0.004     .8607109    4.407836
           _IYear_2017 |          0  (omitted)
        --------------------------------------------------------------------------------
        Underidentification test (Kleibergen-Paap rk LM statistic):              8.572
                                                           Chi-sq(1) P-val =    0.0034
        ------------------------------------------------------------------------------
        Weak identification test (Cragg-Donald Wald F statistic):              909.221
                                 (Kleibergen-Paap rk Wald F statistic):         40.140
        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:                               0.700
                                                           Chi-sq(1) P-val =    0.4027
        Regressors tested:    GREEN_L1
        ------------------------------------------------------------------------------
        Instrumented:         GREEN_L1
        Included instruments: esg_diff_l1 ENV_L1_asp50 Totalassets_L1 ROA_L1
                              SustCommitt_L1 TMTESG_L1 GDP_L1 FDI_L1 _IYear_2012
                              _IYear_2013 _IYear_2014 _IYear_2015 _IYear_2016
        Excluded instruments: A_L1
        Dropped collinear:    US _IYear_2017
        ------------------------------------------------------------------------------
        Control Function Approach:

        Code:
        xtpoisson GREEN_L1 A_L1 US esg_diff_l1 ENV_L1_asp50 Totalassets_L1 ROA_L1 SustCommitt_L1 TMTESG_L1 GDP_L1 FDI_L1 i.Year, fe vce(robust)
        predict double v2h_fe
        xtreg ENV v2h_fe c.GREEN_L1##c.US c.GREEN_L1##c.esg_diff_l1 c.GREEN_L1##c.ENV_L1_asp50 Totalassets_L1 ROA_L1 SustCommitt_L1 TMTESG_L1 GDP_L1 FDI_L1 i.Year, fe vce(robust)
        drop v2h_fe
        
        
        
        . xtpoisson GREEN_L1 A_L1 US esg_diff_l1 ENV_L1_asp50 Totalassets_L1 ROA_L1 SustCommitt_L1 TMTESG_L1 GDP_L1 FDI_L1 i.Year, fe 
        > vce(robust)
        note: 58 groups (58 obs) dropped because of only one obs per group
        note: 74 groups (264 obs) dropped because of all zero outcomes
        note: 2017.Year omitted because of collinearity
        note: US dropped because it is constant within group
        
        Iteration 0:   log pseudolikelihood = -1641.6741  
        Iteration 1:   log pseudolikelihood = -1236.3381  
        Iteration 2:   log pseudolikelihood = -1231.6346  
        Iteration 3:   log pseudolikelihood = -1231.6332  
        Iteration 4:   log pseudolikelihood = -1231.6332  
        
        Conditional fixed-effects Poisson regression    Number of obs     =        776
        Group variable: UltimatePare~D                  Number of groups  =        126
        
                                                        Obs per group:
                                                                      min =          2
                                                                      avg =        6.2
                                                                      max =          7
        
                                                        Wald chi2(12)     =     204.89
        Log pseudolikelihood  = -1231.6332              Prob > chi2       =     0.0000
        
                                 (Std. Err. adjusted for clustering on UltimateParentID)
        --------------------------------------------------------------------------------
                       |               Robust
              GREEN_L1 |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
        ---------------+----------------------------------------------------------------
                  A_L1 |   .0051603   .0008051     6.41   0.000     .0035824    .0067383
           esg_diff_l1 |   -.004561   .0011398    -4.00   0.000    -.0067949   -.0023271
          ENV_L1_asp50 |   .0243499   .0759953     0.32   0.749    -.1245983     .173298
        Totalassets_L1 |   1.37e-12   1.71e-12     0.80   0.424    -1.98e-12    4.72e-12
                ROA_L1 |    .005304   .0056449     0.94   0.347    -.0057599    .0163679
        SustCommitt_L1 |   .3348747   .0935126     3.58   0.000     .1515933     .518156
             TMTESG_L1 |    -.01329   .1366364    -0.10   0.923    -.2810925    .2545124
                GDP_L1 |   7.66e-14   5.92e-14     1.29   0.196    -3.95e-14    1.93e-13
                FDI_L1 |    .008009   .0038965     2.06   0.040     .0003719    .0156461
                       |
                  Year |
                 2012  |  -.0802039   .0521135    -1.54   0.124    -.1823444    .0219366
                 2013  |  -.0176289   .0752402    -0.23   0.815    -.1650969    .1298391
                 2014  |  -.0284022   .0857549    -0.33   0.740    -.1964786    .1396743
                 2015  |  -.1213473   .0954169    -1.27   0.203    -.3083609    .0656664
                 2016  |  -.0645669   .0553616    -1.17   0.244    -.1730736    .0439398
                 2017  |          0  (omitted)
        --------------------------------------------------------------------------------
        
        . 
        . predict double v2h_fe
        (option xb assumed; linear prediction)
        (430 missing values generated)
        
        . 
        . xtreg ENV v2h_fe c.GREEN_L1##c.US c.GREEN_L1##c.esg_diff_l1 c.GREEN_L1##c.ENV_L1_asp50 Totalassets_L1 ROA_L1 SustCommitt_L1 
        > TMTESG_L1 GDP_L1 FDI_L1 i.Year, fe vce(robust)
        note: US omitted because of collinearity
        note: GREEN_L1 omitted because of collinearity
        note: GREEN_L1 omitted because of collinearity
        note: 2017.Year omitted because of collinearity
        
        Fixed-effects (within) regression               Number of obs     =      1,098
        Group variable: UltimatePa~D                    Number of groups  =        258
        
        R-sq:                                           Obs per group:
             within  = 0.2721                                         min =          1
             between = 0.4580                                         avg =        4.3
             overall = 0.4721                                         max =          7
        
                                                        F(16,257)         =          .
        corr(u_i, Xb)  = 0.5261                         Prob > F          =          .
        
                                          (Std. Err. adjusted for 258 clusters in UltimateParentID)
        -------------------------------------------------------------------------------------------
                                  |               Robust
                              ENV |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
        --------------------------+----------------------------------------------------------------
                           v2h_fe |  -5.510343   6.659385    -0.83   0.409    -18.62425    7.603568
                         GREEN_L1 |  -.0345648   .0556004    -0.62   0.535    -.1440552    .0749255
                               US |          0  (omitted)
                                  |
                  c.GREEN_L1#c.US |   .1828708   .0451808     4.05   0.000      .093899    .2718426
                                  |
                         GREEN_L1 |          0  (omitted)
                      esg_diff_l1 |   .0362834   .0346789     1.05   0.296    -.0320075    .1045744
                                  |
         c.GREEN_L1#c.esg_diff_l1 |  -.0003446    .000216    -1.60   0.112    -.0007699    .0000807
                                  |
                         GREEN_L1 |          0  (omitted)
                     ENV_L1_asp50 |  -12.11324   1.921763    -6.30   0.000    -15.89765    -8.32883
                                  |
        c.GREEN_L1#c.ENV_L1_asp50 |   .0780588   .0260248     3.00   0.003     .0268098    .1293078
                                  |
                   Totalassets_L1 |  -2.05e-11   2.07e-11    -0.99   0.321    -6.12e-11    2.01e-11
                           ROA_L1 |     .07229   .0594553     1.22   0.225    -.0447916    .1893717
                   SustCommitt_L1 |   5.385251   2.916073     1.85   0.066    -.3571899    11.12769
                        TMTESG_L1 |   1.983515   2.023395     0.98   0.328    -2.001031    5.968061
                           GDP_L1 |   4.25e-13   1.02e-12     0.42   0.678    -1.59e-12    2.44e-12
                           FDI_L1 |  -.0782285   .0811136    -0.96   0.336    -.2379603    .0815034
                                  |
                             Year |
                            2012  |    .821968   .8894646     0.92   0.356    -.9295991    2.573535
                            2013  |   .4744543   .9780917     0.49   0.628    -1.451641    2.400549
                            2014  |   1.272812   1.401662     0.91   0.365    -1.487395    4.033018
                            2015  |   4.116511   1.854511     2.22   0.027     .4645375    7.768484
                            2016  |    2.06098    1.01907     2.02   0.044     .0541901    4.067771
                            2017  |          0  (omitted)
                                  |
                            _cons |   31.71745   9.094386     3.49   0.001     13.80845    49.62646
        --------------------------+----------------------------------------------------------------
                          sigma_u |  24.137384
                          sigma_e |  8.2402691
                              rho |  .89561809   (fraction of variance due to u_i)
        -------------------------------------------------------------------------------------------
        
        . 
        . drop v2h_fe
        
        .
        All the best
        Patrick

        Comment

        Working...
        X