Open dreistein543 opened 2 years ago
It's tricky.
Here's an excerpt from my own code that does this. Maybe you can adapt it for your purposes.
// HERE BE DRAGONS
// The following lines takes the last item of the triple interactions — whether VariableC or VariableD — and puts
// them onto new lines (the line with the standard errors).
// I think this flavor of sed might only work on macOS, and you'd need to change the hardcoded path names.
// (Update: as of macOS Catalina and the switch to zsh from bash, some of the triple backslashes below are now sextuple backslashes.)
// It's very difficult to pass the appropriate paths through while handling the tilde and spaces correctly.
// What is this doing exactly? Well by uncommenting the following "echo" command, you'll see the command that actually
// gets passed to bash.
* shell echo sed -Ei '.orig' 's/(\\$\\times\\$ )VariableC(.*)$/\1\\ldots\2'$'\\\n \\\\\\quad\\\\\\ldots VariableC/g' "/path/to/output.tex"
shell sed -Ei '.orig' 's/(\\$\\times\\$ )VariableC(.*)$/\1\\ldots\2'$'\\\n \\\\\\quad\\\\\\ldots VariableC/g' "/path/to/output.tex"
shell sed -Ei '.orig' 's/(\\$\\times\\$ )VariableD(.*)$/\1\\ldots\2'$'\\\n \\\\\\quad\\\\\\ldots VariableD/g' "/path/to/output.tex"
shell sed -Ei '.orig' '/^[& ]+\\\\\\\\$/d' "/path/to/output.tex"
Wow! I think the best news is I do use Stata on macOS so that I may replicate your method. No matter whether I can handle them, thank you Nils.
if our models contain interaction terms, considering the length of their name/label, the table may be too wide, especially when you output too many models once a time.
many journals display their interactive terms as a two row thing as follow:
the first term is the default result of
esttab
while the second term is what I want so that i can reduce the width of my table and it could fit thetextwidth
.have i miss something
esttab
can do? or is it tricky?