Dear listers,
After running a number of regressions using -reghdfe-, I output the estimates into Excel using -esttab-,
To later compare the effects of different explanatory variables in different samples, I want to discuss the marginal effect of 1 standard deviation (SD) of the explanatory variable of interest, hence add to the bottom of each table column the SD in the estimation sample, as well as its product with the marginal effect estimated. I also want to add a cell specifying whether or not the estimations displayed in that column did include year fixed effects. For now, I use the following code:
Follow-up questions on this:
1. The most obvious weakness for now is that while the number of observations is displayed with 0 and the R2 with 3 digits after the comma, as intended, the following 2 statistics are displayed with far more columns although I have specified the desired number of digits in the same way. Would anyone happen to see how I have to change the code to get the desired number of digits?
2. Ideally I'd like the number of observations to be didplayed not only with 0 after comma digits but also with some separation between every 3 pre comma digits to improve readability. How can I specify this?
3. I am not sure what format I should specify for the local YFE, which is a text, although here it seems not to matter much that I just specify a number format?
4. Any other things I should improve in this code?
Thank you so much!
PM
After running a number of regressions using -reghdfe-, I output the estimates into Excel using -esttab-,
To later compare the effects of different explanatory variables in different samples, I want to discuss the marginal effect of 1 standard deviation (SD) of the explanatory variable of interest, hence add to the bottom of each table column the SD in the estimation sample, as well as its product with the marginal effect estimated. I also want to add a cell specifying whether or not the estimations displayed in that column did include year fixed effects. For now, I use the following code:
Code:
eststo clear eststo: reghdfe y x sum x if e(sample) estadd local sd = r(sd) estadd local sdeff = r(sd)*_b[x] estadd local YFE "No" esttab using "table", scsv b(3) se(3) replace star(* 0.1 ** 0.05 *** 0.01) stats(N r2 SD sdeff YFE, fmt(%9.0f %9.3f %9.3f %9.3f %9.3f))
1. The most obvious weakness for now is that while the number of observations is displayed with 0 and the R2 with 3 digits after the comma, as intended, the following 2 statistics are displayed with far more columns although I have specified the desired number of digits in the same way. Would anyone happen to see how I have to change the code to get the desired number of digits?
2. Ideally I'd like the number of observations to be didplayed not only with 0 after comma digits but also with some separation between every 3 pre comma digits to improve readability. How can I specify this?
3. I am not sure what format I should specify for the local YFE, which is a text, although here it seems not to matter much that I just specify a number format?
4. Any other things I should improve in this code?
Thank you so much!
PM
Comment