Announcement

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

  • Adding test statistic to a table for a first stage IV using esttab and ivreg2

    Hi,

    I am trying to get a table of my first stage using ivreg2 and esttab. I would like to add the overidentification test statistic as well as the F statistic for the excluded instruments to the table. I have tried to do it using the "scalars"-option in esttab and calling on "j" and "widstat". It adds a row for both j and widstat, but adds no values. Is there some way to fix this?

    I am using the following code:

    Code:
    eststo: ivreg2 checks_diff (mean_aid_pop75 = colony popratio75 col_popratio75) checks_first, r first savefirst savefprefix(checks1)
    
    esttab checks* using "$out\first_stages_checks.tex",cells(b(star fmt(3)) se(par fmt(3))) label star(* 0.10 ** 0.05 *** 0.01) booktabs scalars(widstat j) title(First stage for the period 1975-2019 \label{reg1}) addnotes("All variables are means for for the period, except initial checks")replace
    My data looks like this:

    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input float(checks_diff mean_aid_pop75 colony popratio75 col_popratio75 checks_first)
     3.3333335 3.6907804 1  -.8628807  -.8628807         1
             0  55.43914 1  1.0814705  1.0814705         1
             2  58.38091 1    1.20673    1.20673         1
     .33333325  59.96497 1   .5728483   .5728483         2
     1.8333334  19.88667 0 -1.8594017          0 1.1666666
             1   77.3685 1   .7803202   .7803202         1
           3.5  2.270266 1 -2.2848072 -2.2848072         1
            -1  131.7344 1   2.689328   2.689328         3
             2  6.934492 1  .02991295  .02991295         1
             0 1.1726826 0 -4.4304066          0         1
     1.3333333  52.98597 1    .531806    .531806         1
     1.1666667  50.92534 1   .3816843   .3816843         1
     3.8333335 31.214815 1  -.7412529  -.7412529         1
           2.5  91.79053 1   1.960431   1.960431         1
             2  12.51031 1  -.7907391  -.7907391         2
    -1.6666667  43.90652 1   1.650876   1.650876         4
            .5  62.28271 1   2.821203   2.821203         3
             1 19.336376 0   .7520866          0         1
             2 13.206845 1  -.4198265  -.4198265         1
      .6666666 18.926846 1   .4449406   .4449406 1.3333334
     -.8333334  62.23111 1 -1.2618923 -1.2618923 2.1666667
             2  27.78533 0 -1.0932541          0         1
            -3 106.61917 1   2.940602   2.940602         4
             2 111.55469 1   2.824618   2.824618         1
     1.6666666  49.12981 1  .08886147  .08886147 1.3333334
    -.16666675 103.82304 1   3.006254   3.006254         3
     1.6666667 127.76946 1  2.6566334  2.6566334         1
             1  26.73812 1  .57665825  .57665825         3
     1.3333333 123.35879 1   2.683275   2.683275         2
             3 73.581604 1  1.2416067  1.2416067         1
             4  65.85674 1   .7618656   .7618656         1
             2         0 0 .034812927          0         1
      2.833333  7.892386 1 -2.4827175 -2.4827175         1
     -.1666665 3.2543175 1  -4.044672  -4.044672 4.1666665
             2 2.3594623 0 -1.0982437          0         1
     .33333325 287.71716 1   1.150218   1.150218         3
             1  67.90886 1  1.6829815  1.6829815         3
     1.6666667  43.54558 1   -.218256   -.218256         1
             0  2.364017 0  -1.173296          0         3
             0 34.942703 1 -.23137283 -.23137283         3
     3.3333335  94.69737 1  2.2409353  2.2409353         1
             0  48.79314 1  -.4889431  -.4889431         1
           2.5  40.36388 1  .36769485  .36769485         1
     3.3333335  3.353338 1 -1.6977482 -1.6977482         1
     1.1666667 71.841644 1  .52096844  .52096844         1
     .16666663 176.20226 1   2.104415   2.104415         1
    -1.6666667  68.78692 1    2.50433    2.50433         4
             2   59.4459 1    .706461    .706461         1
           1.5 10.731293 1 -.10829163 -.10829163         3
            -1   80.5605 0  2.4435205          0         2
     1.3333333  56.65337 1   .7442827   .7442827         1
           2.5  8.482095 1  -1.759018  -1.759018       1.5
             1 111.74078 0   1.357974          0         1
             3  15.75013 1 -1.8119144 -1.8119144         1
             2   24.2945 0  1.8332043  1.8332043         1
             3 20.472513 1   -.345932   -.345932         1
           3.5 12.014452 0 -1.3304768 -1.3304768         1
            -1 127.94538 1  1.2458353  1.2458353         4
             1  21.05519 0   1.363556   1.363556         1
     3.3333335         0 1  -.6683655          0         1
             2  80.99821 1   .9164886   .9164886         1
             1  97.46998 1    .794733    .794733         1
             0  6.975947 0  1.5735264  1.5735264         2
     2.1666667  59.36668 1  1.2791185  1.2791185         1
             3  60.12527 1   .9658031   .9658031         1
      .3333334 166.01363 1   .3703871   .3703871         1
            .5  47.75142 1   .9818459   .9818459         1
             1  54.24771 1  1.5102262  1.5102262         1
     -.4666666  8.185507 0 -1.3553677          0       1.8
            -1  8.785644 1  2.3791656  2.3791656         4
             3  61.57366 1   .6571627   .6571627         1
     -5.166667 17.404825 1 -1.2806053 -1.2806053  7.333333
             2  41.05482 1  .01630783  .01630783         1
             1 11.932553 0   1.349703          0         1
     .33333325 2.3428912 1 -.18938065 -.18938065         3
           -.5 10.788183 1  -.8366127  -.8366127       2.5
           2.5  95.51285 1   .7920113   .7920113         1
     1.3333333  44.95705 1   .5504637   .5504637  2.666667
    end




  • #2
    See #4 for esttab (SSC): https://www.statalist.org/forums/for...-stage-outcome

    Comment


    • #3
      Thank you so much, Andrew! That solved my problem :-)

      Comment

      Working...
      X