asdocx: Export from Stata to Word, Excel, LaTeX & HTML › Forums › asdocx Forum › Writing Local Matrices with asdocx in Stata › Reply To: Writing Local Matrices with asdocx in Stata
Please update asdocx and try the following example:
asdocx_update
* Reset any previous matrix
flexmat reset
* Add data through addcell command
flexmat addcell, data(Year) r(1) c(1)
flexmat addcell, data(Mean) r(1) c(2)
flexmat addcell, data(SD) r(1) c(3)
flexmat addcell, data(2001) r(2) c(1)
flexmat addcell, data(1.5%) r(2) c(3)
flexmat addcell, data(1.5%) r(2) c(3)
flexmat addcell, data(5.1%) r(2) c(2)
* Add more data through addrow command
flexmat addrow, data(2002, 6.74, 1.68) row(3) col(1)
flexmat addrow, data(2003, 6.58, 1.61) row(4) col(1)
* Start a new matrix at location 2
flexmat addrow, data(Year, P75) loc(2)
flexmat addrow, data(2001, 4%) loc(2) row(2)
flexmat addrow, data(2004, 9.3) loc(2) row(3)
* Merge the matrices at location 1 and two
flexmat merge, matloc(1,2)
0 |1 2 3 4
----+-----------------------------------------------------------------------------
1 |Year Mean SD P75
----+-----------------------------------------------------------------------------
2 |2001 5.1% 1.5% 4%
3 |2002 6.74 1.68
4 |2003 6.58 1.61
5 |2004 9.3
----------------------------------------------------------------------------------