Announcement

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

  • Time Fixed Effects in Latex Table Export

    Hello everyone!

    Quick question: I am trying to run some FE regressions to export to Latex and in the Latex tables I would like to 1) indicate which FEs have been used and 2) the coefficients for the time FE (there are two years 1803 and 1806). How can I achieve that? I have tried several combinations, the following is the closest I got, I see which FEs have been used but the years coefficients have not been indicated. Can you help me figuring out where the mistake is? Thanks in advance!


    ************************************************** ******************************
    **** Regressions ****
    ************************************************** ******************************

    keep if insp_yr==1803 | insp_yr==1806

    egen geo_id = group(arr_id_reg dpt_id )
    egen time_id = group(insp_yr)
    xtset geo_id time_id


    local depvars Klk Kjk Klf Kjf Kjm Kmm Ksm Kmbm Ksbm
    foreach var in `depvars' {
    eststo clear

    xtreg `var' spy_s, fe
    eststo model1
    xi: xtreg `var' spy_s i.time_id , fe
    eststo model2
    xi: xtreg `var' spy_s i.time_id*i.regionn, fe
    eststo model3
    xi: xtreg `var' spy_s i.time_id*i.dpt_id, fe
    eststo model4

    esttab model1 model2 model3 model4 using "$path/results/`var'.tex", ///
    indicate("Year FEs = *tim*" "Year $\times$ region FEs = *reg*" "Department x year FEs = *dpt*" ) drop(_cons) ///
    se label ///
    collabels(none) ///
    varlabels(_cons "Constant") ///
    title("Regression Results for `varLabel'") ///
    replace
    eststo clear
    }

  • #2
    estout is from SSC, as you are asked to explain (FAQ Advice #12). Why are you using the -xi- prefix with xtreg? This command supports factor variables. See

    Code:
    help fvvarlist

    Comment


    • #3
      Hi Andrew,

      Thanks for you reply. The issue is that if I do not use xi then I cannot use indicate() to highlight which FEs have been used, as dpt for instance has dozens of different names and I cannot pinpoint them using just *dpt* which instead xi allows. Does it make sense?

      Comment


      • #4
        Let's see a reproducible example.

        Comment

        Working...
        X