|
Size: 1428
Comment:
|
← Revision 4 as of 2025-10-24 17:48:58 ⇥
Size: 1431
Comment: Link
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 3: | Line 3: |
| The '''`tabulate`''' command creates tabulations. Compare to [[Stata/Table|table]]. | '''`-tabulate-`''' tabulates data. See also [[Stata/Table|-table-]]. |
| Line 27: | Line 29: |
| The `tab1` alias forces the command to be interpretted as a one-way `tabulate` command. Note that `tab1 foo bar baz` will create one-way tables for each of the variables. | The '''`-tab1-`''' alias forces the command to be interpreted as a one-way `tabulate` command. Note that `tab1 foo bar baz` will create one-way tables for each of the variables. |
| Line 41: | Line 43: |
| The `tab2` alias forces the command to be interpretted as a two-way `tabulate` command. Note that `tab2 foo bar baz` will create three tables: ''foo x bar'', ''foo x baz'', and ''bar x baz''. | The '''`-tab2-`''' alias forces the command to be interpreted as a two-way `tabulate` command. Note that `tab2 foo bar baz` will create three tables: ''foo x bar'', ''foo x baz'', and ''bar x baz''. |
| Line 49: | Line 51: |
| The '''`matcell(MATNAME)`''' option stores frequencies in a matrix. | The '''`matcell(MATNAME)`''' option stores frequencies in a [[Stata/Matrices|matrix]]. |
| Line 59: | Line 61: |
| [[https://www.stata.com/manuals/rtabulateoneway.pdf|Stata manual for tabulate oneway]] | [[https://www.stata.com/manuals/rtabulateoneway.pdf|Stata manual for -tab1-]] |
| Line 61: | Line 63: |
| [[https://www.stata.com/manuals/rtabulatetwoway.pdf|Stata manual for tabulate twoway]] | [[https://www.stata.com/manuals/rtabulatetwoway.pdf|Stata manual for -tab2-]] |
Stata Tabulate
-tabulate- tabulates data.
See also -table-.
Usage
One-way
tabulate foo tabulate foo if bar==1 tabulate foo in 1/10
To show missing values, add the missing option.
To sort rows in descending frequency, add the sort option.
The -tab1- alias forces the command to be interpreted as a one-way tabulate command. Note that tab1 foo bar baz will create one-way tables for each of the variables.
Two-way
tabulate foo bar tabulate foo bar if baz==1 tabulate foo bar in 1/10
To show missing values, add the missing option.
The -tab2- alias forces the command to be interpreted as a two-way tabulate command. Note that tab2 foo bar baz will create three tables: foo x bar, foo x baz, and bar x baz.
Matrices
The matcell(MATNAME) option stores frequencies in a matrix.
The matrow(MATNAME) option stores unique values in a matrix.
See also
Stata manual for tabulate, summarize
