Hi all
I am using sumat from SSC in Stata 17 to export 2 way table to putdocx.
It work fine but I am having problem with adding header with categoric names when I export table to putdocx , example:
Here You can see the putdocx table without categoric names: Domestic and Foreign
Thanks in advance
Rodrigo
I am using sumat from SSC in Stata 17 to export 2 way table to putdocx.
It work fine but I am having problem with adding header with categoric names when I export table to putdocx , example:
Code:
clear all
sysuse auto
putdocx begin
*Work fine headers are ok:
sumat mpg, statistics(mean sd) rowby(rep78) colby(foreign) decimals((2,2,2,2,2,2))
----------------------------------------------------------------------------
Car origin(Domestic) Car origin(Foreign)
mean sd mean sd
string
Repair record 1978(1) 21.00 4.24
Repair record 1978(2) 19.13 3.76
Repair record 1978(3) 19.00 4.09 23.33 2.52
Repair record 1978(4) 18.44 4.59 24.89 2.71
Repair record 1978(5) 32.00 2.83 26.33 9.37
----------------------------------------------------------------------------
matrix tbl = r(sumat)
putdocx table tablename = matrix( tbl ), nformat(%6.2f) rownames colnames
putdocx save ejemplo.docx, replace
Thanks in advance
Rodrigo

Comment