I want to produce and export (to Latex) a table of summary statistics for one variable, where the summary statistics are reported in different rows, while different populations of interest are considered in each column. I am using `esttab` or `estout` together with `estpost` from SSC. This seems very simple but I have been working at this for hours, and cannot figure out how to get `esttab` or `estout` to label the rows with the name of the statistic.
Minimum working example:
I want the first column, which currently just has "price", to have "mean cv min p1 p5 p50 p95 p99 max count" each in separate rows, instead of reporting these labels in the column header with slashes dividing them.
I have tried playing with varlabels(), main(), aux(), coeflabels(), labcol2(), using summarize rather than tabstat... can anyone assist? It seems this should be very simple and I must be missing something. If it's too difficult with `esttab` or `estout`, is there another command for exporting descriptive stats of this kind to Latex which people could recommend?
Minimum working example:
Code:
sysuse auto, clear eststo testme1: estpost tabstat price if foreign==0, s(mean cv min p1 p5 p50 p95 p99 max count) columns(statistics) eststo testme2: estpost tabstat price if foreign==1, s(mean cv min p1 p5 p50 p95 p99 max count) columns(statistics) esttab testme1 testme2, cells(mean cv min p1 p5 p50 p95 p99 max count) noobs mtitles(column1 column2) nonumbers
Code:
-------------------------------------- column1 column2 mean/cv/mi~a mean/cv/mi~a -------------------------------------- price 6072.423 6384.682 .5100278 .4106571 3291 3748 3291 3748 3667 3798 4782.5 5759 13594 11995 15906 12990 15906 12990 52 22 --------------------------------------
I have tried playing with varlabels(), main(), aux(), coeflabels(), labcol2(), using summarize rather than tabstat... can anyone assist? It seems this should be very simple and I must be missing something. If it's too difficult with `esttab` or `estout`, is there another command for exporting descriptive stats of this kind to Latex which people could recommend?
Comment