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

    Working...
    X