Tristan said
"
> Is there a fast way to get the results of a twoway table with multiple
> statistics into a matrix format so I can access all the results
> programmaticly. I'm hoping to create a way to produce a latex table
> from the table command. Suggestions?
>
> I assume there is nothing like this already made (I'm aware of
> labtabstat outtable etc). Ideally it would produce a latex file with
> rows and columns plus multiple lines within each cell for each
> statistic.
This does not produce the within-each-cell format, but the ability to
do that just involves some LaTeX directives applied to the result. The
'replace' option on 'table' is the key to hanging on to its results:
sysuse auto
preserve
table rep78 foreign,c(sum price mean price median mpg max weight)
replace
rename table1 sum_price
rename table2 mu_price
rename table3 median_mpg
rename table4 max_weight
mkmat *,mat(a)
mat rownames a= 1 2 3 4 5 6 7 8
outtable using cars,mat(a) replace
--------