Announcement

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

  • Automatically add fixed effect indicators to esttab after reghdfe using -indicate()-

    Sharing this code on Statalist as I hope I had found it earlier (The regular indicate option discussed in most posts did not work with reghdfe, with one exception). This was missing from prior posts and solves many issues. -indicate(`r(indicate_fe)')- in esttab options automatically select the fixed effects that were included in the estimated models. If you want to change the labels use -estfe . , labels(fevar "somelabel")
    REGHDFE | Frequently Asked Questions – Sergio Correia (scorreia.com)
    how to indicate specific variables when using reghdfe and estfe? - Statalist
    HTML Code:
    * Setup
    sysuse auto
    
    * Run and store regressions
    reghdfe price weight length, a(turn) keepsing
    estimates store model1
    reghdfe price weight length, a(turn trunk) keepsing
    estimates store model2
    reghdfe price weight length, a(turn foreign) keepsing
    estimates store model2
    
    * Prepare estimates for -estout-
        estfe . model*, labels(turn "Turn FE" turn#trunk "Turn-Trunk FE")
        return list
    
    * Run estout/esttab
        esttab . model* , indicate("Length Controls=length" `r(indicate_fe)')
            
    * Return stored estimates to their previous state
        estfe . model*, restore

  • #2
    However, I am not able to get #1 to work for ivreghdfe. It seems to only work on reghdfe.

    Comment

    Working...
    X