Data Management Utility. Allows to produce and export table of results in a matricial format.
tablemat varlist [if] [in] [weight] , stat(varname) [bygroup(varlist) clean(string) format(format) name(string) output(file name) short trim(real)]
where :
stat is the statistic variable - not optional - (to be calculated by tabs > tat),
bygroup is a list of the by-variables (more than 2 could be specified), separated by spaces,
clean is the character to be removed specified by the user,
format is the format type,
name is the name of the save matrice of results (default is M),
output is the option to export results,
trim is the length to assign to value labels,
short applies the trimming size to all labels.
Description
tablemat is an extension of tabstat.
tablemat produces a matrice of results using tabstat.
The statistics available are those of tabstat except q. The weights options are also those supported by tabstat. The improvement over tabstat is that tabstat allows only one -by- variable while tablemat allows as many by-variables as the user wishes. Another advantage is the handle of labels.
Version 8.2 or higher is required.
Examples
. tablemat has_water has_elec, st(mean)
. tablemat has_water has_elec, st(mean) cl((&) name(myresults)
. mat li myresults
. tablemat has_water [aw=weight], st(mean) by(urbrur region quintile educ)
. tablemat var1 var2 [aw=weight], st(median) byg(region ) out("C:\N\File.out")
. tablemat var1 var2 [aw=weight], st(p25) f(%9.2f) tr(5) sh
Author
Amadou Bassirou DIALLO, AFTPM, The World Bank -and- CERDI, Univ. of Auvergne (France).
Email: adiallo5@worldbank.org
Aknowledgements
Some parts of this program have been built through my incessant questions to Stata List. I would like to thank Nick Cox, Kit Baum and other stata users for their patience and their helpful comments on various aspects of this program. Kit Baum earlier found a bug that has been fixed.
Also see
[R] tabstat [R] tabstatmat
Manual: [R] summarize, [R] tabulate, [R] matrix.
Online: help for summarize, tabstat, tabstatmat, tabulate, statsmat, outtable, outsheet, mat2txt if installed.
-------------------------------------------------------------------------------