Hi,
I need your help, if possible, to identify am I doing wrong in the code below.
I am trying to report in a table the outcome of the DiD regression run with 35 different dependent variables, but in the file it appears only the table in relation to the first dependent variable (nyrpat).
Moreover, can I kindly ask you how can I add line that counts the number of firms included in the sample?
local dependent_vars "nyrpat ngyrpat annexploit8 annexplore8 ty02a ty02b ty02c ty02d ty02e ty02p ty02t ty02w ty04s anngexploit8 anngexplore8 tfcites tgfcites tadjfcites tadjfcitxplt tadjfcitxplr tadjgfcites tadjgfcitxplt tadjgfcitxplr txi_nominal txi_real tepltxi_nom teplrxi_nom tepltxi_real teplrxi_real tgxi_nominal tgxi_real tgepltxi_nom tgeplrxi_nom tgepltxi_real tgeplrxi_real"
matrix clear results
// Run DiD regression and
foreach var of local dependent_vars {
regress `var' i.rggi##i.yd
outreg2 using temp.xlsx, append replace
matrix results = results, r(table)'
}
putexcel set "regression_results.xlsx", replace
putexcel A1 = matrix(results)
putexcel close
Thanks a lot.
I need your help, if possible, to identify am I doing wrong in the code below.
I am trying to report in a table the outcome of the DiD regression run with 35 different dependent variables, but in the file it appears only the table in relation to the first dependent variable (nyrpat).
Moreover, can I kindly ask you how can I add line that counts the number of firms included in the sample?
local dependent_vars "nyrpat ngyrpat annexploit8 annexplore8 ty02a ty02b ty02c ty02d ty02e ty02p ty02t ty02w ty04s anngexploit8 anngexplore8 tfcites tgfcites tadjfcites tadjfcitxplt tadjfcitxplr tadjgfcites tadjgfcitxplt tadjgfcitxplr txi_nominal txi_real tepltxi_nom teplrxi_nom tepltxi_real teplrxi_real tgxi_nominal tgxi_real tgepltxi_nom tgeplrxi_nom tgepltxi_real tgeplrxi_real"
matrix clear results
// Run DiD regression and
foreach var of local dependent_vars {
regress `var' i.rggi##i.yd
outreg2 using temp.xlsx, append replace
matrix results = results, r(table)'
}
putexcel set "regression_results.xlsx", replace
putexcel A1 = matrix(results)
putexcel close
Thanks a lot.