I am trying to format a table with frequencies and percentages for a single variable for export to LaTeX using the new Stata collect/table combination. I'm using Stata 17 on Windows.
I'd like to add a horizontal rule all the way across on top of the "total"-row. (In general, I'd like to figure out how to put horizontal lines wherever I'd like, not just around the four levels of border_block.)
By reading different sources (manual, Stata blog, Statalist), I’ve been able to put a line on top of the numbers, but I’d like it on top of the “Total” text as well. Is this possible?
Below is an example of how far I got:
I'd like to add a horizontal rule all the way across on top of the "total"-row. (In general, I'd like to figure out how to put horizontal lines wherever I'd like, not just around the four levels of border_block.)
By reading different sources (manual, Stata blog, Statalist), I’ve been able to put a line on top of the numbers, but I’d like it on top of the “Total” text as well. Is this possible?
Below is an example of how far I got:
Code:
sysuse auto, clear
collect clear
table foreign, ///
statistic(frequency) ///
statistic(percent)
collect style cell result[percent], sformat("%s%%")
collect style cell border_block, border(right, pattern(nil))
collect style cell cell_type[item]#foreign[.m], border(top)
collect preview

Comment