I am trying to export a two-way summary table to LaTeX using the community-contributed command estout
. This is a table summarizing the mean values of numerical weight
across two categorical variables foreign
and pricehigh
:
sysuse auto, clear
gen pricehigh = 0
replace pricehigh = 1 if price > 6165
tabulate foreign pricehigh, summarize(weight) means label
Means of Weight (lbs.)
| pricehigh
Car type | 0 1 | Total
-----------+----------------------+----------
Domestic | 3,080.513 4,026.923 | 3,317.115
Foreign | 2,118.462 2,601.111 | 2,315.909
-----------+----------------------+----------
Total | 2,840 3,443.636 | 3,019.459
However, Stata tells me that the summarize()
option for tabulate
is not allowed when using tabulate
and estpost
:
estpost tabulate foreign pricehigh, summarize(weight) means label
option summarize() not allowed
r(198);
I have been searching the estout
documentation (particularly here) and Statalist, but cannot find how to re-create this table using estout
.