Announcement

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

  • Adding F-Stat of first stage regression using ivreghdfe and estout

    My code is the following

    Code:
    eststo: ivreghdfe y (x=z), a(Year) first savefirst savefprefix(st1)
    mat list e(first)
    estadd scalar F2 = e(first)[4,1]
    esttab est1 st1*
    esttab st1* est1, scalar (F F2)
    The problem is that the F-Stat from the first stage ends up in the column of the second-stage regression. The reason I put F2 is because if I write the following

    Code:
    estadd scalar F = e(first)[4,1]
    I receive an error that says
    e(F) already defined r(110)
    This makes me think maybe I need pull out the F-Stat from the first stage in my line of code where I am appending the stored results/regressions.

    Code:
    esttab st1* est1, scalar (F F2)
    After reading help for esttab I used ereturn list to see where the number was being stored and it is stored under e(widstat). So I ran

    Code:
    eststo clear
    eststo: ivreghdfe y (x=y), a(Year) first savefirst savefprefix(st1)
    esttab st1* est1 using mytable.rtf, scalar (widstat F)
    However, it still shows up in the wrong column. I have posted my table below as a png if it is easier to find the problem.
    Click image for larger version

Name:	statlist_1-1.png
Views:	1
Size:	75.4 KB
ID:	1541114


  • #2
    Code:
    sysuse auto, clear
    eststo clear
    eststo: ivreghdfe price (weight=length), a(foreign) first savefirst savefprefix(st1)
    
    // Take a scalar from the [active] second stage estimation (est1) and add it to first stage estimation (st1weight)
    estadd scalar F = `e(widstat)' : st1weight
    
    esttab st1weight est1, scalar(F)
    The above yields:

    Code:
    --------------------------------------------
                          (1)             (2)   
                       weight           price   
    --------------------------------------------
    length              31.44***                
                      (19.64)                   
    
    weight                              2.869***
                                       (6.60)   
    --------------------------------------------
    N                      74              74   
    F                   385.6           43.55   
    --------------------------------------------
    t statistics in parentheses
    * p<0.05, ** p<0.01, *** p<0.001

    Comment


    • #3
      Is it possible also to include the P-Value of F-stat of the first stage as well as the Hansen J statistic in the esttab?

      Comment


      • #4
        The Hansen J is in e(j), and it's p-value is in e(jp).

        The p-value of the F-stat (Cragg-Donald or Kleibergen-Paap), is, I think, not available. The F-stat is usually compared to critical value thresholds given in Stock and Yogo (2005), which are helpfully provided in the output of ivreghdfe/ivreg2, rather than reported as a p-value.

        Comment


        • #5
          Okay, thanks Nils.

          You are right, the F-stat should be compared to critical value thresholds given in Stock and Yogo (2005). But one of the referees asked to include the p-value as well in the table in my paper. Since in the log file I only showed the output of esttab (I "quietly" run the ivreghdfe), therefore, I need to not run using "quietly", which is a bit silly just to copy paste the p-value of F-stat.

          Comment

          Working...
          X