0

I run -reghdfe-, a fixed effect model. Using -esttab, indicate()- I would like to append which FE are included, in an automated fashion.

See two examples: Stata - How to get Indicator Variable Indicators (Yes/No) to Appear in esttab LaTeX Output and Stata tables: Using esttab, indicate() with xtreg

Where the first example works if we use i.myFactorvariable. However, I run

reghdfe y x, cl(i.industry) a(i.industry)

Can I also here append cells in a way similar to: "Industry FE" "YES/NO" , using esttab?

cascom
  • 33
  • 5
  • An option was suggested using -estadd- https://www.stata.com/statalist/archive/2012-05/msg01359.html I am wondering if a shorter option is possible (as in the links within the original post). – cascom May 09 '23 at 17:54

2 Answers2

0

I think outreg2 will help with appending cells similar to what you want

  • -outreg2- does a similar job, but for personal reasons of repeatedly appending results for each outcome variable, I prefer remaining in -esttab- – cascom May 10 '23 at 10:03
0

If I remember correctly, esttab, indicate() parses the column names of the parameter vector e(b) to search for the indicator variables. As reghdfe does not contain the fixed effects in there, the search is therefore unsuccessful.

As a quick fix, you can run:

reghdfe y x o.industry, absorb(industry) cluster(industry)

This adds industry as an omitted variable to the regression (this does not alter the result but creates an entry in e(b) as a missing value). The downside of this fix is that if you omit the fixed effects but keep the o.industry, the output will show erroneously a "yes", even though the variable is not included in the regression. As a side note, you can omit the i. in the absorb and cluster option.

Example:

sysuse auto, clear

// initial problem
reghdfe price turn, absorb(foreign)
est store test1
// quick fix
reghdfe price turn o.foreign, absorb(foreign)
est store test2
// incorrect indication
reghdfe price turn o.foreign, noabsorb
est store test3

esttab test1 test2 test3, indicate(foreign)

Output:

. esttab test*, indicate(foreign)

------------------------------------------------------------
                      (1)             (2)             (3)   
                    price           price           price   
------------------------------------------------------------
turn                379.2***        379.2***        207.6** 
                   (4.12)          (4.12)          (2.76)   

_cons             -8871.0*        -8871.0*        -2065.0   
                  (-2.42)         (-2.42)         (-0.69)   

foreign                No             Yes             Yes   
------------------------------------------------------------
N                      74              74              74   
------------------------------------------------------------
t statistics in parentheses
* p<0.05, ** p<0.01, *** p<0.001