Generate markdown tables from Stata commands

estimation commands

. use margex, clear

. logistic outcome i.sex i.group sex#group age

outcome Coef. Std. Err. z P>|z|[95% Conf. Interval]
sex
female -.1486283 .1700125 -0.87 0.382 -.4818467 .1845901
group
2 -1.660621 .2376133 -6.99 0.000 -2.126334 -1.194907
3 -1.886826 .3204395 -5.89 0.000 -2.514876 -1.258776
sex#group
female#2 1.587323 .2803675 5.66 0.000 1.037812 2.136833
female#3 .675973 .7993847 0.85 0.398 -.8907923 2.242738
age .0915069 .006574 13.92 0.000 .0786222 .1043917
_cons -5.079056 .3567167 -14.24 0.000 -5.778208 -4.379904

table

. use byssin, clear
. table workplace smokes race [fw=pop], c(mean prob) format(%9.3f) sc markdown

(Byssinosis incidence)

Dustiness Race and Smokes
of other white Total
workplace no yes no yes no yes
least 0.011 0.010 0.008 0.016 0.009 0.014
less 0.020 0.008 0.014 0.014 0.016 0.012
most 0.082 0.168 0.083 0.230 0.083 0.193

estimates table

. sysuse auto
. regress mpg gear turn
. estimates store small
. regress mpg gear turn length
. estimates store large
. estimates table small large, b(%7.4f) se(%7.4f) stats(N r2_a) markdown
Variable small large
gear_ratio 3.0329 1.3567
1.3730 1.2898
turn -0.7331 -0.1219
0.1424 0.1908
length -0.1666
0.0387
_cons 41.2180 53.3487
8.9907 8.5306
N 74 74
r2_a 0.5355 0.6275

legend: b/se

The Stata default markdown supports multimarkdown table format