Announcement

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

  • Problems with the Esttab command

    Dear Stata community,

    I have currently an issue with the esttab command. I want to run a loop of regressions with different model specifications (a baseline and two specific ones, "export" and "climat") and different dependent variables (emphre empnbh diff_h emphre01 so 4 in total), giving me at the end 12 coefficients. Moreover, even if I have several independent variables, in my regression table I would like to display only the interaction term (dummy_treat here). However, with the esttab command I get a table with 12 columns and 1 row, whereas I would something a 4rows x 3 columns table:
    Click image for larger version

Name:	Capture d’écran 2019-03-11 à 18.39.39.png
Views:	4
Size:	43.9 KB
ID:	1487574

    I tried to look at outreg, estout or matrices but, I am looking for a nice 4x3 regression table with beta coefficient and standard errors in bracket
    This is the code that I have for now:

    gen baseline=1
    estimates clear
    set more off
    loc list_of_xs baseline climat export
    foreach y in `list_of_xs ' {
    local i = 1
    foreach var of varlist emphre empnbh diff_h emphre01 {
    eststo model`i'`y': xi: xtreg `var' dummy_treat dummy `y' if time==1 & (dum_ger==1 | dum_lux==1 | dum_che==1 | dum_bel==1) & emphre!=. & empnbh<70 & exclu_dd_reg!=1 & empnbh6>3 & exclu1!=1 & exclu2!=1 & nace!="EA" & nace!="ER" & nace!="EQ", fe robust cluster(newid)
    local ++i
    }
    }
    esttab, replace keep(dummy_treat) cells(b(star fmt(3)) se(par({ }) fmt(3))) starlevels(* 0.10 ** 0.05 *** 0.01) stardetach depvars ///
    legend mlabels("Overtime Hours" "Hours Worked" "Gap" "Probability of Overtime" "Overtime Hours" "Hours Worked" "Gap" "Probability of Overtime" "Overtime Hours" "Hours Worked" "Gap" "Probability of Overtime") varlabel (off) varwidth(15)


    Do you know I could actually re-configure my 1x12 regression table in a nice 4x3 table ?

    Best,
    Nicolas

    * NB: Please note that I am using STATA 14
Working...
X