-------------------------------------------------------------------------------
help for tabstatmat
-------------------------------------------------------------------------------

Save matrices saved by tabstat to single named matrix

tabstatmat matname [ , nototal safe ]

Description

tabstatmat picks up matrices saved after tabstat. These matrices will have names r(Stat1), etc., together with their rownames saved as r(name1), etc., and/or r(StatTot) or r(StatTotal). These matrices are combined and put them in the single named matrix matname. If matname already exists, it will be overwritten unless option safe is specified; in this case, an error message will be issued.

Remarks

Note that not all requests to tabstat produce output in suitable form. In particular, a call that requests multiple statistics for multiple groups and multiple variables is not suitable. tabstatmat cannot be smart about detecting such calls and labelling rows or columns correctly. tabstat does not save all the necessary information in row and column names and composite row or column names such as "Foreign N" would be illegal in any case.

Options

nototal suppresses the picking up of marginal totals.

Examples

. sysuse auto, clear . tabstat mpg, by(rep78) s(n mean sd) save . tabstatmat mpgstat . tabstatmat mpgstat, nototal

Author

Austin Nichols austinnichols@gmail.com

Acknowledgements

The first seven versions of tabstatmat were written by Nicholas J. Cox, Durham University. The problem was suggested by Friedrich Huebler, who also advised of problems arising when only r(StatTot) is saved by tabstat. Lucy Chung advised that a previous version had been broken by a change to tabstat in Stata 9. Fredrik Wilhelmsson indicated a bug when totals are not saved and how to fix it. He also suggested the nototal option. Zurab Sajaia advised of a bug when matrices with many rows are requested and suggested how to fix it and made other useful suggestions.

Also see:

Online: help for tabstat, matrix, statsmat (if installed), tabexport (if installed), tabout (if installed), outmat (if installed), outsum