Hi,
The aim is to create a matrix which can be exported to excel using -putexcel-.
-tabstat, save- results in the creation of:
macros:
With this as background:
The aim is to create a matrix which can be exported to excel using -putexcel-.
Code:
sysuse auto local var mpg rep78 price tabstat `var', by(foreign) s(median mean) save return list
macros:
r(name2): "Foreign"matrices
r(name1): "Domestic"
r(Stat2): 2 x 3It would be useful to create a matrix which was a 3 x 6 matrix which is comprised of macros and matrices (ie almost identical in layout to the tabstat display in Stata). This matrix could then be transferred into Excel using -putexcel- and there is the need to only reference one cell (e.g. B3). Otherwise, there would be five elements to take across using -putexcel-.
r(Stat1): 2 x 3
r(StatTotal): 2 x 3
With this as background:
- Is it possible to create a matrix using these components? If so, which commands would I use?
- If the -tabstat, save- command returned only scalars [e.g. r(r1) r(r2) r(r3)], would it be possible to create a matrix with these? If so, is it the same command as for 1?
Comment