Dear all,
I am quite new to Stata, so please excuse my basic question.
At the moment, I am running a couple of regressions and I am using the 'estout' package to generate tables for LaTex. With the 'refcat' option, I assign headers to subgroups of the regression variables. For the sake ot a nice looking table, I want to ident the variable labels after the headers.
I have already found a solution for identing in LaTex. However, this approach changes the variables labes and puts "\hspace{0.1cm} " in front of each label. This works perfectly fine.
My question: after creating all LaTex files, I want to change the labels back to its originals, i.e. I want to remove the LaTex command at the beginning of each label. I assume, that I need to use another for-loop to loop through all variables and remove the LaTex command. However, I don't know how to do that. Does anyone have an idea?
My current code looks the following:
Thank you in advance!
I am quite new to Stata, so please excuse my basic question.
At the moment, I am running a couple of regressions and I am using the 'estout' package to generate tables for LaTex. With the 'refcat' option, I assign headers to subgroups of the regression variables. For the sake ot a nice looking table, I want to ident the variable labels after the headers.
I have already found a solution for identing in LaTex. However, this approach changes the variables labes and puts "\hspace{0.1cm} " in front of each label. This works perfectly fine.
My question: after creating all LaTex files, I want to change the labels back to its originals, i.e. I want to remove the LaTex command at the beginning of each label. I assume, that I need to use another for-loop to loop through all variables and remove the LaTex command. However, I don't know how to do that. Does anyone have an idea?
My current code looks the following:
Code:
foreach v of varlist * { label variable `v' `"\hspace{0.1cm} `: variable label `v''"' } esttab using testfile.tex, replace refcat(ESG_lag "\emph{ESG Data}" TobinsQ "\emph{Control Variables}", nolabel) label booktabs collabels(none) gaps se r2 ar2 mtitles("Cash" "Incentive" "Total") star(* 0.10 ** 0.05 *** 0.01) compress eststo clear
Comment