Hi everyone,
I am trying to produce some nice tables with -reghdfe- by Sergio Correia.
I am trying to follow his advices on his website. Here is what I am trying:
But the tables produced are not very nice.
Here is a small -dataex-:
Any suggestions to improve my code, please?
Thank you very much in advance!
I am trying to produce some nice tables with -reghdfe- by Sergio Correia.
I am trying to follow his advices on his website. Here is what I am trying:
Code:
reghdfe ln_p engine_cap, absorb(brand model) estimates store model1 * reghdfe ln_p engine_cap power_kw, absorb(brand model) estimates store model2 * reghdfe ln_p engine_cap power_kw, absorb(brand model year) estimates store model3 * reghdfe ln_p engine_cap power_kw i.ev_type_encode, absorb(brand model) estimates store model4 * reghdfe ln_p engine_cap power_kw i.ev_type_encode i.regulation_mad##i.ev_type_encode, absorb(brand model) estimates store model5 * reghdfe ln_q ln_p, absorb(brand model ev_type_encode) estimates store model6 * reghdfe ln_q ln_p i.ev_type_encode i.regulation_mad##i.ev_type_encode, /// absorb(muni_code brand model) vce(cluster muni_code) estimates store model7 * * Prepare estimates for -estout- estfe . model*, labels(brand "Brand FE" brand#model "Brand-Model FE" year "Year FE" ev_type_encode "EV FE") return list * Run estout/esttab esttab . model* using "C:/Users/miduarte/Desktop/reghdfe_tables_test.xlsx", indicate(`r(indicate_fe)') r2 replace * Return stored estimates to their previous state estfe . model*, restore
But the tables produced are not very nice.
Here is a small -dataex-:
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str23 brand str60 model str4 fuel long(engine_cap muni_code) double power_kw float(fiscal_power mad_dum regulation_mad mad_prov ln_p ln_q) int year long ev_type_encode "ALFA ROMEO" "4C" "0" 1742 28093 177 12.25 1 0 28 11.03489 1.3862944 2015 3 "ALFA ROMEO" "4C" "0" 1742 37274 177 12.25 0 0 37 11.03489 1.3862944 2015 3 "ALFA ROMEO" "4C" "0" 1742 47231 177 12.25 0 0 47 11.03489 1.3862944 2015 3 "ALFA ROMEO" "4C" "0" 1742 3031 177 12.25 0 0 3 11.03489 1.3862944 2015 3 "ALFA ROMEO" "GIULIA" "1" 2143 47155 100 13.88 0 0 47 10.210972 2.397895 2016 3 "ALFA ROMEO" "GIULIA" "1" 2143 47052 100 13.88 0 0 47 10.210972 2.397895 2016 3 "ALFA ROMEO" "GIULIA" "1" 2143 46256 100 13.88 0 0 46 10.210972 2.397895 2016 3 end label values ev_type_encode ev_type_encode label def ev_type_encode 3 "combustion", modify
Any suggestions to improve my code, please?
Thank you very much in advance!
Comment