Announcement

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

  • Heckman test

    I have firm-year panel data (cluster by firm id). My main treatment variable is HARD_FREEZE (dummy):
    - firms that never hard-freeze: HARD_FREEZE=0 for all years
    - firms that hard-freeze: HARD_FREEZE=0 in pre-freeze years and HARD_FREEZE=1 in the freeze year
    - I drop post-freeze years (I do not study years after the freeze)

    Outcome: CSR_DISC (continuous). I also include CSO_PRESENCE and the interaction HARD_FREEZEXCSO_PRESENCE,
    plus standard controls and year and industry (ff_12) fixed effects.

    I am concerned about self-selection/endogeneity in HARD_FREEZE and attempted a Heckman-style correction by:
    1) Probit model for HARD_FREEZE
    2) Generate inverse Mills ratio (mills) from the probit linear prediction
    3) Include mills in the CSR regression (estimated on all observations)

    My code (without asdoc formatting) is:

    probit HARD_FREEZE SIZE LEV MB OCF SD_OCF BOARD_SIZE GENDER_RATIO BOARD_IND FUND_STATUS ///
    FUND_RATIO PLAN_SIZE i.year i.ff_12, vce(cluster id)

    predict lefthat if e(sample), xb
    gen mills = normalden(lefthat) / normal(lefthat) if e(sample)

    reg CSR_DISC HARD_FREEZE CSO_PRESENCE HARD_FREEZEXCSO_PRESENCE SIZE LEV MB OCF SD_OCF ///
    BOARD_SIZE GENDER_RATIO BOARD_IND SUS_SCORE SUS_COMM FUND_STATUS FUND_RATIO PLAN_SIZE ///
    mills i.year i.ff_12, vce(cluster id)

    Questions:
    1) Is this a correct way to implement a Heckman correction for “self-selection into HARD_FREEZE”
    when CSR_DISC is observed for all observations in the analysis sample?
    (i.e., is adding mills from probit(HARD_FREEZE) to an OLS on all obs valid?)
    2) If this is not correct, what is the recommended Stata approach for a continuous outcome with an
    endogenous binary regressor/treatment (HARD_FREEZE)?

    HTML Code:
    . do "C:\Users\lenovo\AppData\Local\Temp\STDa04_000000.tmp"
    
    . asdoc probit  HARD_FREEZE   SIZE       LEV   MB   OCF   SD_OCF  BOARD_SIZE  GENDER_RATIO  BOARD
    > _IND    FUND_STATUS  FUND_RATIO  PLAN_SIZE  i.year    i.ff_12  ,  robust cluster (id) nest repl
    > ace  drop(i.year i.ff_12  ) dec(4) tzok    save(qqqqa)
    
    Iteration 0:  Log pseudolikelihood = -358.75999  
    Iteration 1:  Log pseudolikelihood = -327.72275  
    Iteration 2:  Log pseudolikelihood = -324.57221  
    Iteration 3:  Log pseudolikelihood = -324.53113  
    Iteration 4:  Log pseudolikelihood = -324.53103  
    Iteration 5:  Log pseudolikelihood = -324.53103  
    
    Probit regression                                       Number of obs =  3,900
                                                            Wald chi2(40) =  94.12
                                                            Prob > chi2   = 0.0000
    Log pseudolikelihood = -324.53103                       Pseudo R2     = 0.0954
    
                                       (Std. err. adjusted for 282 clusters in id)
    ------------------------------------------------------------------------------
                 |               Robust
     HARD_FREEZE | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
    -------------+----------------------------------------------------------------
            SIZE |  -.1925695   .0740725    -2.60   0.009    -.3377488   -.0473902
             LEV |  -.0087306   .4015024    -0.02   0.983    -.7956607    .7781996
              MB |   .0002073   .0073871     0.03   0.978    -.0142711    .0146857
             OCF |  -3.458301   1.245414    -2.78   0.005    -5.899267   -1.017335
          SD_OCF |   3.875817   2.853238     1.36   0.174    -1.716427     9.46806
      BOARD_SIZE |  -.0004025   .0297384    -0.01   0.989    -.0586887    .0578837
    GENDER_RATIO |   .3799744   .6574852     0.58   0.563    -.9086729    1.668622
       BOARD_IND |   .2277899   .6650473     0.34   0.732    -1.075679    1.531259
     FUND_STATUS |  -4.173805   2.029593    -2.06   0.040    -8.151735   -.1958759
      FUND_RATIO |  -.0761674   .3856172    -0.20   0.843    -.8319632    .6796285
       PLAN_SIZE |   .0687444   .0637423     1.08   0.281    -.0561882    .1936771
                 |
            year |
           2005  |  -.2409666   .4322112    -0.56   0.577    -1.088085    .6061518
           2006  |   .0026222    .381609     0.01   0.995    -.7453177    .7505622
           2007  |   -.220559   .4408242    -0.50   0.617    -1.084559    .6434405
           2008  |   .4790183    .321579     1.49   0.136    -.1512649    1.109302
           2009  |   .6453316    .312803     2.06   0.039      .032249    1.258414
           2010  |   .4765423    .325337     1.46   0.143    -.1611064    1.114191
           2011  |   .2260907   .3614312     0.63   0.532    -.4823015     .934483
           2012  |       .361   .3465188     1.04   0.298    -.3181643    1.040164
           2013  |   .4685907   .3371055     1.39   0.165     -.192124    1.129305
           2014  |   .2758176   .3544123     0.78   0.436    -.4188177    .9704528
           2015  |    .438984   .3475913     1.26   0.207    -.2422823     1.12025
           2016  |   .3682024   .3422007     1.08   0.282    -.3024986    1.038903
           2017  |   .3257874   .3579784     0.91   0.363    -.3758373    1.027412
           2018  |   .7495029   .3326064     2.25   0.024     .0976063    1.401399
           2019  |   .5081082   .3590654     1.42   0.157    -.1956471    1.211864
           2020  |   .7474426   .3516579     2.13   0.034     .0582058    1.436679
           2021  |   .3653477   .4157055     0.88   0.379    -.4494201    1.180115
           2022  |   .0776221   .4568847     0.17   0.865    -.8178554    .9730996
                 |
           ff_12 |
              2  |   .0701796   .2884724     0.24   0.808     -.495216    .6355752
              3  |  -.2088294   .2146219    -0.97   0.331    -.6294806    .2118218
              4  |  -.3456759   .3760136    -0.92   0.358    -1.082649    .3912973
              5  |  -.3439714   .2487806    -1.38   0.167    -.8315724    .1436295
              6  |  -.1551492   .2504892    -0.62   0.536    -.6460991    .3358007
              7  |   .1184574   .3654636     0.32   0.746    -.5978381    .8347529
              8  |   -.406023   .2438484    -1.67   0.096     -.883957    .0719111
              9  |   .4415868   .2073734     2.13   0.033     .0351424    .8480312
             10  |  -.0921214   .2570592    -0.36   0.720    -.5959483    .4117054
             11  |   .4643857   .2316409     2.00   0.045     .0103778    .9183935
             12  |  -.3317513   .2383857    -1.39   0.164    -.7989788    .1354762
                 |
           _cons |  -1.089957   .7413996    -1.47   0.142    -2.543073    .3631599
    ------------------------------------------------------------------------------
    Click to Open File:  qqqqa.doc
    
    . 
    . predict lefthat, xb // Get the linear prediction
    (4681 missing values generated)
    
    . gen mills = normalden(lefthat) / normal(lefthat) // Generate the inverse Mill's ratio
    (4,681 missing values generated)
    
    . 
    . 
    . asdoc reg CSR_DISC  HARD_FREEZE  CSO_PRESENCE  HARD_FREEZEXCSO_PRESENCE SIZE       LEV  MB   OC
    > F   SD_OCF  BOARD_SIZE GENDER_RATIO BOARD_IND SUS_SCORE SUS_COMM    FUND_STATUS  FUND_RATIO PLA
    > N_SIZE mills i.year    i.ff_12 ,   robust cluster (id) nest replace  drop(i.year i.ff_12  ) dec
    > (4) tzok  save(qqqkkq)
    
    Linear regression                               Number of obs     =      3,210
                                                    F(45, 265)        =      82.25
                                                    Prob > F          =     0.0000
                                                    R-squared         =     0.7327
                                                    Root MSE          =      9.339
    
                                                   (Std. err. adjusted for 266 clusters in id)
    ------------------------------------------------------------------------------------------
                             |               Robust
                    CSR_DISC | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
    -------------------------+----------------------------------------------------------------
                 HARD_FREEZE |   6.264576   2.157665     2.90   0.004     2.016228    10.51292
                CSO_PRESENCE |   4.940515   1.003364     4.92   0.000     2.964935    6.916096
    HARD_FREEZEXCSO_PRESENCE |   11.74723   3.839324     3.06   0.002     4.187765    19.30669
                        SIZE |   4.118176   5.715745     0.72   0.472    -7.135875    15.37223
                         LEV |   2.109673    3.31258     0.64   0.525    -4.412651    8.631998
                          MB |  -.0698221   .0285052    -2.45   0.015    -.1259476   -.0136966
                         OCF |    97.2196   104.8254     0.93   0.355    -109.1771    303.6163
                      SD_OCF |  -79.62506   118.0351    -0.67   0.501     -312.031    152.7809
                  BOARD_SIZE |   .3070938   .1880339     1.63   0.104    -.0631367    .6773242
                GENDER_RATIO |  -7.023461   12.48731    -0.56   0.574    -31.61043    17.56351
                   BOARD_IND |  -7.603016   8.288169    -0.92   0.360    -23.92206    8.716026
                   SUS_SCORE |   .4259821   .0275958    15.44   0.000     .3716473     .480317
                    SUS_COMM |   2.088117    .948821     2.20   0.029       .21993    3.956304
                 FUND_STATUS |   91.92552   127.6094     0.72   0.472    -159.3319    343.1829
                  FUND_RATIO |   .0192403   3.532275     0.01   0.996    -6.935654    6.974135
                   PLAN_SIZE |  -1.082472   2.037977    -0.53   0.596    -5.095159    2.930215
                       mills |  -25.47822   34.18466    -0.75   0.457    -92.78633    41.82989
                             |
                        year |
                       2006  |  -4.373616   7.821997    -0.56   0.577    -19.77479    11.02755
                       2007  |   1.747812   1.767486     0.99   0.324     -1.73229    5.227915
                       2008  |  -15.13568   22.58608    -0.67   0.503    -59.60667    29.33532
                       2009  |  -18.25729   27.63952    -0.66   0.509    -72.67829    36.16372
                       2010  |  -13.55586   22.55711    -0.60   0.548    -57.96983    30.85811
                       2011  |  -7.140786   14.95481    -0.48   0.633    -36.58615    22.30457
                       2012  |   -8.83993   19.07473    -0.46   0.643    -46.39723    28.71737
                       2013  |  -9.791559   22.35421    -0.44   0.662    -53.80603    34.22291
                       2014  |  -3.596534   16.41043    -0.22   0.827    -35.90795    28.71488
                       2015  |  -3.999571   21.40539    -0.19   0.852    -46.14585    38.14671
                       2016  |  -1.341657   19.25826    -0.07   0.945    -39.26032    36.57701
                       2017  |   1.654498   17.95445     0.09   0.927    -33.69703    37.00602
                       2018  |  -7.953823   30.78313    -0.26   0.796    -68.56445    52.65681
                       2019  |  -.9603528   23.44141    -0.04   0.967    -47.11547    45.19477
                       2020  |  -5.065944   30.69163    -0.17   0.869    -65.49642    55.36453
                       2021  |   4.119329   19.18789     0.21   0.830     -33.6608    41.89945
                       2022  |    11.0519   10.25829     1.08   0.282    -9.146224    31.25002
                             |
                       ff_12 |
                          2  |  -5.528289   3.408065    -1.62   0.106    -12.23862    1.182041
                          3  |   4.454642   6.694695     0.67   0.506     -8.72692     17.6362
                          4  |   16.19785   11.59032     1.40   0.163    -6.622988    39.01868
                          5  |   14.32454   10.57837     1.35   0.177    -6.503813    35.15289
                          6  |    4.73878   5.014423     0.95   0.346      -5.1344    14.61196
                          7  |  -.2542357   5.377176    -0.05   0.962    -10.84166    10.33319
                          8  |   17.30009   12.58141     1.38   0.170    -7.472164    42.07234
                          9  |  -20.45107   13.75656    -1.49   0.138    -47.53713    6.634986
                         10  |   4.658465    3.76444     1.24   0.217    -2.753552    12.07048
                         11  |  -16.90209   13.98326    -1.21   0.228    -44.43452    10.63034
                         12  |   9.345867   10.47308     0.89   0.373    -11.27517     29.9669
                             |
                       _cons |   32.26755    62.6324     0.52   0.607     -91.0529     155.588
    ------------------------------------------------------------------------------------------
    Click to Open File:  qqqkkq.doc
    
    . 
    end of do-file

  • #2
    I'd think teffects is the way to go since you'll get the correct SE. With IPWRA RA, you'll be doubly robust.

    but at first glance, this looks correct. with mills insignificant, you can ignore the first stage (at least check to see if coefs vary a lot with and without it). if a stronger effect on mills, you'd need to bootstrap across both models or else get the Murphy-Topel Covariance matrix (or similar).
    Last edited by George Ford; 21 Dec 2025, 13:39.

    Comment

    Working...
    X