Tabulation of multiple variables
tabm varlist [weight] [if exp] [in range] [, missing replace transpose valuelabel(lblname) tabulate_options]
by ... : may be used with tabm: see help by.
fweights, aweights and iweights are allowed with tabm; see help weights.
Description
tabm tabulates varlist, containing two or more comparable variables, in a combined two-way table of variables in varlist by values in varlist. Either all variables should be numeric, or all variables should be string: the type of the first variable named is taken to indicate the user's intentions. By default, variables are listed in the rows of the table and values in the columns.
Remarks
For further discussion of handling multiple responses in Stata, see Cox and Kohler (2003) and Jann (2005).
Options
missing specifies that observations with missing values are to be included. The default is that any observation with any missing value on the variables specified is excluded.
replace specifies that the tabulated data overwrite the data in question. The new variables will be _stack, indexing variables, _values, the distinct values of varlist, and (if weights are specified) _weight, the weights. replace may not be specified with by:.
transpose transposes rows and columns as compared with the default. This option may be needed if there are too many values to show as columns.
valuelabel(lblname) specifies a value label name to be used in tabulation. The default is that any value label associated with the first numeric variable in varlist will be used. This option will be ignored in tabulation of string variables.
tabulate_options are options allowed with tabulate varname1 varname2.
Examples
. tabm q1-q15
Author
Nicholas J. Cox, Durham University, U.K. n.j.cox@durham.ac.uk
Acknowledgments
Lee Sieswerda suggested making tabm byable and helped in testing.
References
Cox, N.J. and Kohler, U. 2003. On structure and shape: the case of multiple responses. Stata Journal 3: 81-99.
Jann, B. 2005. Tabulation of multiple responses. Stata Journal 5: 92-122.
Also see
On-line: help for tabulate; mrtab (if installed)